@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
    --ui-brand: #465fff;
    --ui-brand-dark: #3641f5;
    --ui-brand-soft: #eef1ff;
    --ui-bg: #f4f6fb;
    --ui-surface: #ffffff;
    --ui-text: #0f172a;
    --ui-muted: #64748b;
    --ui-border: #e8ecf4;
    --ui-radius: 1rem;
    --ui-radius-lg: 1.25rem;
    --ui-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
    --ui-shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.04), 0 20px 40px rgba(15, 23, 42, 0.08);
}

* {
    -webkit-tap-highlight-color: transparent;
}

.modern-ui-body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--ui-bg);
    color: var(--ui-text);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

.modern-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.modern-page--center {
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    padding-top: max(1.25rem, env(safe-area-inset-top));
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

.modern-page--split {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
}

@media (min-width: 1024px) {
    .modern-page--split {
        grid-template-columns: 1fr 1fr;
    }
}

.modern-staging-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #f59e0b;
    color: #fff;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.4rem 0.75rem;
    padding-top: max(0.4rem, env(safe-area-inset-top));
}

.modern-staging-banner + .modern-page {
    padding-top: 1.75rem;
}

.modern-brand-panel {
    display: none;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #465fff 0%, #5b6cff 45%, #7c3aed 100%);
    padding: 3rem 2.5rem;
}

@media (min-width: 1024px) {
    .modern-brand-panel {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.modern-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 40%);
    pointer-events: none;
}

.modern-brand-content {
    position: relative;
    z-index: 1;
    max-width: 22rem;
    width: 100%;
    text-align: center;
    color: #fff;
}

.modern-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 1.125rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin-bottom: 1.25rem;
}

.modern-logo svg {
    width: 2rem;
    height: 2rem;
    color: var(--ui-brand);
}

.modern-brand-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.modern-brand-sub {
    margin-top: 0.35rem;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.85);
}

.modern-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 1.25rem;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
    .modern-form-panel {
        padding: 3rem;
    }
}

.modern-form-inner {
    width: 100%;
    max-width: 24rem;
    margin: 0 auto;
}

.modern-mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

@media (min-width: 1024px) {
    .modern-mobile-brand {
        display: none;
    }
}

.modern-mobile-brand .modern-logo {
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0;
    border-radius: 0.875rem;
}

.modern-mobile-brand .modern-logo svg {
    width: 1.35rem;
    height: 1.35rem;
}

.modern-mobile-brand-text h1 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.modern-mobile-brand-text p {
    font-size: 0.75rem;
    color: var(--ui-muted);
}

.modern-heading {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--ui-text);
}

.modern-subheading {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    color: var(--ui-muted);
    line-height: 1.5;
}

.ui-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow);
}

.ui-card-padded {
    padding: 1.5rem;
}

@media (min-width: 640px) {
    .ui-card-padded {
        padding: 2rem;
    }
}

.ui-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

.ui-input {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: 3rem;
    padding: 0 1rem;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--ui-text);
    background: #fafbfc;
    border: 1px solid var(--ui-border);
    border-radius: 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ui-input::placeholder {
    color: #94a3b8;
}

.ui-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--ui-brand);
    box-shadow: 0 0 0 3px rgba(70, 95, 255, 0.12);
}

.ui-input-wrap {
    position: relative;
}

.ui-input-wrap .ui-input {
    padding-right: 2.75rem;
}

.ui-input-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: var(--ui-muted);
    cursor: pointer;
}

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 3rem;
    padding: 0 1.25rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-decoration: none;
}

.ui-btn:active {
    transform: scale(0.98);
}

.ui-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--ui-brand) 0%, var(--ui-brand-dark) 100%);
    box-shadow: 0 4px 14px rgba(70, 95, 255, 0.35);
}

.ui-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(70, 95, 255, 0.4);
}

.ui-btn-secondary {
    color: var(--ui-text);
    background: #fff;
    border: 1px solid var(--ui-border);
}

.ui-btn-secondary:hover {
    background: #f8fafc;
}

.ui-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--ui-muted);
    cursor: pointer;
}

.ui-checkbox input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--ui-brand);
    border-radius: 0.25rem;
}

.ui-alert {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ui-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.ui-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.ui-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ui-brand);
    text-decoration: none;
}

.ui-link:hover {
    color: var(--ui-brand-dark);
    text-decoration: underline;
}

.ui-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.ui-divider::before,
.ui-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ui-border);
}

.modern-service-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (min-width: 1024px) {
    .modern-service-grid {
        margin-top: 2rem;
        text-align: left;
    }
}

.modern-service-card {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: background 0.15s ease, transform 0.1s ease;
}

.modern-service-card:hover {
    background: rgba(255, 255, 255, 0.18);
}

.modern-service-card:active {
    transform: scale(0.98);
}

.modern-service-card--light {
    background: var(--ui-surface);
    border-color: var(--ui-border);
    color: var(--ui-text);
    box-shadow: var(--ui-shadow);
}

.modern-service-card--light:hover {
    background: #fafbfc;
    border-color: #d8dff0;
}

.modern-service-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
}

.modern-service-card--light .modern-service-icon {
    background: var(--ui-brand-soft);
    color: var(--ui-brand);
}

.modern-service-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.modern-service-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
}

.modern-service-desc {
    margin-top: 0.2rem;
    font-size: 0.8125rem;
    opacity: 0.85;
    line-height: 1.4;
}

.modern-service-card--light .modern-service-desc {
    color: var(--ui-muted);
    opacity: 1;
}

/* Public result pages */
.modern-public-header {
    background: linear-gradient(135deg, var(--ui-brand) 0%, #5b6cff 100%);
    padding: 1.5rem;
    color: #fff;
}

.modern-public-header h1 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modern-public-header p {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

.modern-public-header a {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.modern-public-header a:hover {
    text-decoration: underline;
}

.ui-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.75rem;
}

.ui-stat {
    padding: 1rem;
    border-radius: var(--ui-radius);
    background: #f8fafc;
    border: 1px solid var(--ui-border);
}

.ui-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ui-stat-value {
    margin-top: 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ui-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.ui-badge--success { background: #dcfce7; color: #166534; }
.ui-badge--warning { background: #fef9c3; color: #854d0e; }
.ui-badge--info { background: #dbeafe; color: #1e40af; }
.ui-badge--purple { background: #f3e8ff; color: #6b21a8; }
.ui-badge--danger { background: #fee2e2; color: #991b1b; }

.ui-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
}

.ui-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ui-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ui-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--ui-border);
}

.ui-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--ui-border);
    color: var(--ui-text);
}

.ui-table tr:last-child td {
    border-bottom: none;
}

.modern-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ui-muted);
    text-decoration: none;
}

.modern-back-link:hover {
    color: var(--ui-brand);
}

.modern-back-link svg {
    width: 1rem;
    height: 1rem;
}
