:root {
    --bg-main: #f4e4cf;      /* Sand */
    --bg-box: #fff7ea;       /* Light Sand */
    --bg-content: #fffaf1;   /* Very Light Sand */
    --accent: #a06d2e;       /* Brand */
    --accent-dark: #824f18;  /* Hover */
    --accent-soft: #e6c69a;
    --text-main: #2b2620;
    --text-muted: #6b5b4a;
    --border-soft: #e3d2b8;
    --shadow-soft: 0 6px 14px rgba(0, 0, 0, 0.12);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition-fast: 0.18s ease-out;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 32px 16px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background: radial-gradient(circle at top, #fff7ea 0, #f4e4cf 45%, #e0c9a6 100%);
    color: var(--text-main);
}

/* Zurück-Button */

.back-button {
    position: fixed;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 247, 234, 0.94);
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(4px);
    transition: background var(--transition-fast), transform var(--transition-fast),
        box-shadow var(--transition-fast);
    z-index: 10;
}

.back-button:hover {
    background: #fffaf1;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.back-icon {
    font-size: 16px;
    line-height: 1;
}

.back-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* Main Box */

.generator-box {
    background: var(--bg-box);
    width: 100%;
    max-width: 980px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 26px 26px 24px;
}

/* Header */

.generator-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fffaf1;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.logo-text {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-main);
}

.generator-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Layout */

.generator-content {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
    gap: 20px;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Form Elements */

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
}

.field-input {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    padding: 9px 11px;
    font-size: 14px;
    background: var(--bg-content);
    color: var(--text-main);
    outline: none;
    transition: border var(--transition-fast), box-shadow var(--transition-fast),
        background var(--transition-fast), transform var(--transition-fast);
}

.field-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(160, 109, 46, 0.4);
    background: #fffdf7;
    transform: translateY(-1px);
}

.textarea {
    resize: vertical;
    min-height: 160px;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

/* Toggle */

.toggle-row {
    display: flex;
    align-items: center;
    height: 100%;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
}

.toggle input {
    display: none;
}

.toggle-slider {
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: #d7c4a3;
    position: relative;
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(14px);
}

.toggle-label {
    user-select: none;
}

/* Buttons */

.primary-button,
.secondary-button {
    border: none;
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: background var(--transition-fast), transform var(--transition-fast),
        box-shadow var(--transition-fast), color var(--transition-fast);
}

.secondary-button {
    background: var(--bg-content);
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    width: 100%;
    margin-top: 12px;
}

.secondary-button:hover {
    background: #fffdf7;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* Preview */

.preview-column {
    display: flex;
}

.preview-card {
    background: var(--bg-content);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    padding: 14px 14px 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.preview-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--text-main);
}

/* Stats */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.stat-item {
    background: linear-gradient(135deg, #fffdf7, #f6e7d1);
    border-radius: var(--radius-md);
    padding: 7px 9px;
    border: 1px solid rgba(226, 196, 148, 0.7);
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

/* Mode Hint */

.mode-hint-box {
    margin-top: 6px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 250, 241, 0.96);
    border: 1px dashed rgba(226, 196, 148, 0.9);
}

.mode-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 4px;
    background: rgba(160, 109, 46, 0.08);
    color: var(--accent-dark);
}

.mode-hint-text {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* Help Box */

.help-box {
    margin-top: 6px;
    padding: 10px 11px;
    border-radius: var(--radius-md);
    background: rgba(255, 250, 241, 0.96);
    border: 1px solid rgba(226, 196, 148, 0.85);
}

.help-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--text-main);
}

.help-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: var(--text-muted);
}

.help-list li + li {
    margin-top: 2px;
}

code {
    background: rgba(0, 0, 0, 0.04);
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 11px;
}

/* Responsive */

@media (max-width: 880px) {
    body {
        padding: 64px 10px 16px;
    }

    .generator-box {
        padding: 20px 16px 16px;
    }

    .generator-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .preview-card {
        max-width: 420px;
        margin: 0 auto;
    }

    .back-button {
        top: 10px;
        left: 10px;
    }
}

@media (max-width: 520px) {
    .field-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .logo-text {
        font-size: 15px;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
