/* ════════════════════════════════════════════════════════════════
   C-Aui Portal — Design System
   ──────────────────────────────────────────────────────────────── */
:root {
    --dhl-red:        #D40511;
    --dhl-red-dark:   #B30000;
    --dhl-yellow:     #FFCC00;
    --dhl-yellow-soft:#fff3cd;

    --bg-from:        #fff8e1;
    --bg-via:         #fff3cd;
    --bg-to:          #ffe0b2;

    --gray-50:        #f9fafb;
    --gray-100:       #f3f4f6;
    --gray-200:       #e5e7eb;
    --gray-300:       #d1d5db;
    --gray-400:       #9ca3af;
    --gray-500:       #6b7280;
    --gray-600:       #4b5563;
    --gray-700:       #374151;
    --gray-800:       #1f2937;
    --gray-900:       #111827;

    --success:        #16a34a;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --info:           #3b82f6;

    --radius:         10px;
    --radius-lg:      14px;
    --radius-xl:      20px;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.06);
    --shadow:         0 8px 24px rgba(0,0,0,.08);
    --shadow-lg:      0 16px 48px rgba(0,0,0,.12);
    --shadow-glow:    0 8px 32px rgba(212,5,17,.18);

    --font:           'Plus Jakarta Sans', 'Segoe UI', -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: var(--font);
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    background: linear-gradient(160deg, var(--bg-from) 0%, var(--bg-via) 40%, var(--bg-to) 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* ── Decorative blurred circles in background ─────────────────── */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
}
body::before {
    width: 420px; height: 420px;
    background: rgba(255,204,0,.25);
    top: -120px; left: -120px;
}
body::after {
    width: 320px; height: 320px;
    background: rgba(212,5,17,.08);
    bottom: -80px; right: -80px;
}

/* ── Brand header ─────────────────────────────────────────────── */
.brand-badge {
    display: inline-block;
    background: var(--dhl-red);
    color: #fff;
    font-weight: 900;
    letter-spacing: .5px;
    padding: 10px 28px;
    border-radius: 12px;
    font-family: 'Arial Black', Arial, sans-serif;
    box-shadow: 0 6px 20px rgba(212,5,17,.3);
    white-space: nowrap;
}
.brand-subtitle {
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 12px;
}

/* ── Card — glassmorphism ─────────────────────────────────────── */
.card {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}
.card-glass {
    background: rgba(255,255,255,.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ── Form ─────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    letter-spacing: .2px;
}
input[type="text"],
input[type="email"],
input[type="password"],
select, textarea {
    width: 100%;
    padding: .7rem .9rem;
    border: 1.5px solid var(--gray-200);
    background: #fff;
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: inherit;
    color: var(--gray-800);
    transition: border-color .2s, box-shadow .2s, background .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--dhl-red);
    box-shadow: 0 0 0 4px rgba(212,5,17,.12);
}
input::placeholder {
    color: var(--gray-400);
}
.hint {
    font-size: .76rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .2s, opacity .15s;
    white-space: nowrap;
    min-height: 42px;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--dhl-red), #ff3838);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:not(:disabled):hover {
    box-shadow: 0 12px 32px rgba(212,5,17,.32);
}

.btn-secondary {
    background: rgba(255,255,255,.7);
    color: var(--gray-800);
    border: 1.5px solid var(--gray-200);
}
.btn-secondary:not(:disabled):hover {
    background: #fff;
    border-color: var(--gray-300);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #22c55e);
    color: #fff;
    box-shadow: 0 8px 24px rgba(22,163,74,.25);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
    box-shadow: 0 8px 24px rgba(239,68,68,.25);
}

.btn-block { width: 100%; }
.btn-sm    { padding: .4rem .9rem; font-size: .82rem; min-height: 34px; }

/* ── Alert ────────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .88rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
    animation: alert-slide-in .25s ease-out;
}
.alert-error   { background: #fef2f2; color: #991b1b; border-color: var(--danger); }
.alert-success { background: #f0fdf4; color: #166534; border-color: var(--success); }
.alert-warning { background: #fffbeb; color: #854d0e; border-color: var(--warning); }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: var(--info); }

@keyframes alert-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Badge ────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge-pending  { background: rgba(245,158,11,.18); color: #b45309; }
.badge-approved { background: rgba(22,163,74,.15);  color: #15803d; }
.badge-rejected { background: rgba(239,68,68,.15);  color: #991b1b; }
.badge-admin    { background: rgba(212,5,17,.12);   color: var(--dhl-red); }
.badge-operator { background: rgba(59,130,246,.12); color: #1d4ed8; }

/* ── Password strength rules ──────────────────────────────────── */
.pw-rules {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,.6);
    border-radius: 8px;
    font-size: .76rem;
    color: var(--gray-600);
}
.pw-rules-title {
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 4px;
}
.pw-rule {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .12rem 0;
    transition: color .15s;
}
.pw-rule.pass { color: var(--success); font-weight: 600; }
.pw-rule .icon { width: 12px; text-align: center; font-weight: 700; }
.pw-rule.pass .icon::before { content: "✓"; }
.pw-rule.fail .icon::before { content: "•"; }

/* ── Top bar (page header for authenticated pages) ────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,.7);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar .brand {
    font-weight: 900;
    color: var(--dhl-red);
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: .5px;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.topbar .user-email {
    font-size: .82rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* ── Layout helpers ───────────────────────────────────────────── */
.center-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}
.page-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}
.center-wrap {
    max-width: 460px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}
.page-title h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -.5px;
    margin-bottom: .25rem;
}
.page-title small {
    color: var(--gray-500);
    font-size: .85rem;
}

/* ── Spinner ──────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .card { padding: 24px 20px; border-radius: 16px; }
    .topbar { padding: .75rem 1rem; }
    .topbar .user-email { display: none; }
    .brand-badge { font-size: 16px; padding: 8px 20px; }
}
