:root {
    --bg: #f5eee1;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-soft: rgba(255, 255, 255, 0.72);
    --ink: #18232b;
    --muted: #61717b;
    --line: rgba(24, 35, 43, 0.12);
    --accent: #0f8a83;
    --accent-strong: #0b6761;
    --accent-warm: #ef7f45;
    --danger: #c34b4b;
    --success: #1d8b5c;
    --shadow: 0 24px 64px rgba(17, 36, 52, 0.12);
    --radius-lg: 28px;
    --radius-md: 22px;
    --radius-sm: 14px;
    --container: 1220px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(239, 127, 69, 0.14), transparent 24%),
        radial-gradient(circle at 92% 12%, rgba(15, 138, 131, 0.14), transparent 20%),
        linear-gradient(180deg, #f8efe2 0%, #eef4f0 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(var(--container), calc(100% - 1.5rem));
    margin: 0 auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.8rem;
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: '';
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 1rem;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-warm) 100%);
    box-shadow: 0 16px 28px rgba(24, 35, 43, 0.16);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.15rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 800;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #14a29a);
    box-shadow: 0 16px 28px rgba(15, 138, 131, 0.22);
}

.button-secondary {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.78);
    border-color: var(--line);
}

.button-ghost {
    color: var(--muted);
    background: transparent;
    border-color: var(--line);
}

.button-small {
    min-height: 42px;
    padding: 0 1rem;
    font-size: 0.9rem;
}

.button-block {
    width: 100%;
}

.panel {
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--line);
    background: rgba(248, 239, 226, 0.84);
    backdrop-filter: blur(22px);
}

.topbar-inner,
.topbar-actions,
.admin-brand,
.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 0;
}

.admin-brand strong,
.auth-brand strong,
.panel h1,
.panel h2,
.repeat-head h3 {
    font-family: 'Space Grotesk', sans-serif;
}

.admin-brand p,
.auth-brand p,
.panel-heading p,
.admin-intro p,
.auth-copy p,
.auth-note,
.form-actions p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.topbar-actions {
    flex-wrap: wrap;
}

.admin-layout {
    padding: 1.2rem 0 3rem;
}

.admin-stack,
.dashboard-grid,
.repeat-list,
.field-grid,
.auth-form {
    display: grid;
    gap: 1rem;
}

.admin-intro h1,
.auth-copy h1 {
    margin: 0 0 0.7rem;
    font-size: clamp(2rem, 6vw, 3.5rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.panel-heading {
    display: grid;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.panel-heading-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.field {
    display: grid;
    gap: 0.5rem;
}

.field span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.field input,
.field textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(24, 35, 43, 0.12);
    border-radius: 16px;
    color: var(--ink);
    background: #fcfaf6;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(15, 138, 131, 0.45);
    box-shadow: 0 0 0 4px rgba(15, 138, 131, 0.12);
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.repeat-item {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.repeat-item-compact {
    gap: 0.8rem;
}

.repeat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.repeat-head h3 {
    margin: 0;
    font-size: 1.08rem;
    letter-spacing: -0.02em;
}

.remove-button {
    padding: 0;
    border: 0;
    color: var(--danger);
    font-size: 0.92rem;
    font-weight: 700;
    background: transparent;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    align-items: flex-start;
}

.alert {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid transparent;
    font-weight: 700;
}

.alert-success {
    color: var(--success);
    border-color: rgba(29, 139, 92, 0.2);
    background: rgba(29, 139, 92, 0.08);
}

.alert-error {
    color: var(--danger);
    border-color: rgba(195, 75, 75, 0.22);
    background: rgba(195, 75, 75, 0.08);
}

.auth-page {
    display: grid;
    place-items: center;
}

.auth-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-card {
    width: min(100%, 38rem);
    display: grid;
    gap: 1.2rem;
    padding: 1.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-copy {
    display: grid;
    gap: 0.4rem;
}

.auth-note {
    font-size: 0.9rem;
}

@media (min-width: 720px) {
    .container {
        width: min(var(--container), calc(100% - 2rem));
    }

    .two-col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field-full {
        grid-column: 1 / -1;
    }

    .form-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

@media (min-width: 980px) {
    .topbar-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .panel-heading-row {
        flex-direction: row;
        align-items: flex-start;
    }
}

select {
    font: inherit;
}

.brand-mark-image {
    padding: 0.35rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.88);
}

.brand-mark-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.field select,
.field input[type='file'] {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(24, 35, 43, 0.12);
    border-radius: 16px;
    color: var(--ink);
    background: #fcfaf6;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field input[type='file'] {
    padding: 0.65rem 0.75rem;
}

.field input[type='file']::file-selector-button {
    margin-right: 0.8rem;
    padding: 0.65rem 0.9rem;
    border: 0;
    border-radius: 999px;
    color: var(--accent-strong);
    font-weight: 800;
    background: rgba(15, 138, 131, 0.12);
}

.field-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
    word-break: break-all;
}

.upload-grid {
    display: grid;
    gap: 1rem;
}

.upload-card {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.upload-preview {
    display: grid;
    place-items: center;
    min-height: 180px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fcfaf6;
    color: var(--muted);
    font-weight: 700;
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.upload-preview-wide img {
    object-fit: cover;
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.checkbox-field input {
    margin-top: 0.2rem;
    accent-color: var(--accent);
}

.hint-box {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
    border: 1px dashed rgba(15, 138, 131, 0.28);
    border-radius: 18px;
    background: rgba(15, 138, 131, 0.06);
}

.hint-box strong {
    font-family: 'Space Grotesk', sans-serif;
}

.hint-box p {
    margin: 0;
}

@media (min-width: 720px) {
    .upload-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}