:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --muted: #64748b;
    --line: #dbe3ee;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --success: #067647;
    --success-bg: #ecfdf3;
    --radius: 18px;
    --shadow: 0 18px 50px rgba(15, 23, 42, .09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, .10), transparent 34rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-shell {
    width: min(100%, 1080px);
    margin: 0 auto;
    padding: 40px 20px;
}

.form-card {
    background: var(--surface);
    border: 1px solid rgba(219, 227, 238, .8);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: clamp(20px, 4vw, 40px);
}

.form-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .13em;
}

h1 {
    margin: 0;
    font-size: clamp(1.8rem, 5vw, 2.65rem);
    line-height: 1.12;
    letter-spacing: -.035em;
}

.subtitle {
    margin: 10px 0 0;
    color: var(--muted);
}

.subtitle span,
label>span {
    color: var(--danger);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .82rem;
    font-weight: 700;
}

.status-pill a,
.status-pill a:visited,
.status-pill a:hover,
.status-pill a:active {
    color: inherit !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 700;
    transition: all .15s ease;
}

.badge-pill {
    border-radius: 999px;
    padding: 6px 16px;
}

.badge-dark {
    background: #1e293b;
    color: #ffffff;
    border: 1px solid #0f172a;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.1);
}

.badge-dark:hover {
    background: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.15);
}

.section-title {
    margin: 28px 0 14px;
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .04em;
    color: #334155;
    text-transform: uppercase;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.span-2 {
    grid-column: span 2;
}

.field {
    min-width: 0;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: .92rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 12px 13px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

textarea {
    resize: vertical;
    min-height: 116px;
}

select {
    cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .13);
}

/* Fix iOS rendering for date/time inputs */
input[type="date"],
input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    min-height: 48px;
    display: block;
    width: 100%;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

small {
    color: var(--muted);
    font-size: .8rem;
}

.currency-wrap {
    position: relative;
}

.currency-prefix {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #475569;
    font-weight: 700;
    pointer-events: none;
}

.currency-wrap input {
    padding-left: 42px;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.check-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 15px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease, background-color .15s ease;
}

.check-card:hover {
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.check-card input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--primary);
}

.check-card strong,
.check-card small {
    display: block;
}

.check-card strong {
    font-size: .92rem;
}

.check-card small {
    margin-top: 2px;
}

.participant-field {
    max-width: 320px;
    margin-top: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    padding: 11px 17px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, background-color .15s ease, opacity .15s ease;
}

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

.btn:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e9eef5;
    color: #334155;
}

.alert {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: .92rem;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.alert-error {
    background: var(--danger-bg);
    border: 1px solid #fecdca;
    color: var(--danger);
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid #abefc6;
    color: var(--success);
}

@media (max-width: 760px) {
    .page-shell {
        padding: 16px 12px;
    }

    .form-card {
        border-radius: 18px;
        padding: 20px 16px;
    }

    .form-header {
        display: block;
    }

    .header-actions {
        display: flex;
        margin-top: 14px;
        justify-content: flex-start;
    }

    .form-grid,
    .option-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* Auto-suggest search styles */
.suggest-container {
    position: relative;
    width: 100%;
}

.suggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 240px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-top: 6px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.suggest-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid var(--surface-soft);
    transition: background-color .1s ease;
}

.suggest-item:last-child {
    border-bottom: none;
}

.suggest-item:hover,
.suggest-item.active {
    background-color: var(--surface-soft);
}

.suggest-item .suggest-nik {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
}

.suggest-item .suggest-meta {
    font-size: 0.8rem;
    color: var(--muted);
}