/* =====================================================================
   DSI - Driving School Institute
   assets/css/style.css — single source of truth for all pages.
   Loaded on every page after Tailwind CDN, so these rules can rely on
   Tailwind for utility spacing/layout but own all color, type, and
   component styling.
   ===================================================================== */

:root {
    /* --- Palette (professional navy/blue) --- */
    --dsi-bg:        #0b1220;
    --dsi-surface:   #101a2e;   /* card/table/sidebar background */
    --dsi-panel:     #101a2e;   /* alias, used on auth pages */
    --dsi-surface-2: #16213b;   /* hover state, one step lighter */
    --dsi-border:    rgba(148, 163, 184, 0.14);

    --dsi-accent:    #3b82f6;   /* primary blue - road signage */
    --dsi-accent-2:  #60a5fa;   /* lighter blue - links, secondary accents */

    --dsi-text:      #e6e9f0;
    --dsi-text-dim:  #8b94a8;

    --dsi-success:   #34d399;
    --dsi-danger:    #f87171;
    --dsi-warning:   #fbbf24;
}

* { box-sizing: border-box; }

body {
    background: var(--dsi-bg);
    color: var(--dsi-text);
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
}

/* Used only on login.php / signup.php (split-screen and centered-card layouts) */
body.auth-body {
    min-height: 100vh;
    display: flex;
}
body.auth-body.centered {
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

h1, h2, h3, .font-display {
    font-family: 'Manrope', sans-serif;
}

/* ---------------------------------------------------------------------
   Shared surfaces & components (used across dashboard/list/form pages)
   --------------------------------------------------------------------- */

.panel {
    background: var(--dsi-surface);
    border: 1px solid var(--dsi-border);
}

.btn-primary {
    background: var(--dsi-accent);
    color: #fff;
    font-weight: 600;
    padding: 0.55rem 1.1rem;
    border-radius: 0.55rem;
    transition: filter 0.15s ease;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }

.badge { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-active    { background: rgba(52,211,153,0.15); color: var(--dsi-success); }
.badge-completed { background: rgba(96,165,250,0.15); color: var(--dsi-accent-2); }
.badge-dropped   { background: rgba(248,113,113,0.15); color: var(--dsi-danger); }
.badge-cancelled { background: rgba(248,113,113,0.15); color: var(--dsi-danger); }

/* Form inputs used inside modals (e.g. learners.php add/edit) */
.form-input {
    width: 100%;
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    color: var(--dsi-text);
    font-family: inherit;
}
.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.35);
    border-color: var(--dsi-accent);
}

/* ---------------------------------------------------------------------
   App shell: sidebar (desktop rail / mobile drawer) + topbar
   Used by includes/header.php on every authenticated page.
   --------------------------------------------------------------------- */

.sidebar-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 1rem; border-radius: 0.55rem;
    color: var(--dsi-text-dim); font-size: 0.9rem; font-weight: 500;
    transition: all 0.15s ease;
}
.sidebar-link:hover { background: var(--dsi-surface-2); color: var(--dsi-text); }
.sidebar-link.active {
    background: rgba(59,130,246,0.14);
    color: var(--dsi-accent-2);
    border: 1px solid rgba(59,130,246,0.25);
}

#sidebar {
    width: 16rem; min-height: 100vh; position: fixed; top: 0; left: 0; z-index: 40;
    padding: 1.25rem; display: flex; flex-direction: column; gap: 0.15rem;
    transform: translateX(-100%); transition: transform 0.2s ease;
}
#sidebar.open { transform: translateX(0); }
#sidebarOverlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 30; }
#sidebarOverlay.open { display: block; }
#mobileTopbar { display: flex; }
main { margin-left: 0; padding-top: 4.25rem; }

@media (min-width: 1024px) {
    #sidebar { transform: translateX(0); }
    #sidebarOverlay { display: none !important; }
    #mobileTopbar { display: none; }
    main { margin-left: 16rem; padding-top: 2rem; }
}

/* ---------------------------------------------------------------------
   Auth pages: login.php / signup.php
   --------------------------------------------------------------------- */

.brand-panel {
    flex: 1.1; position: relative; overflow: hidden;
    background: linear-gradient(160deg, #0d1730 0%, #0b1220 60%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 4rem 3rem;
}
.brand-content { width: 100%; max-width: 26rem; }

/* Road-line signature motif: dashed lane markings at the outer edges, clear of the text column */
.road-lines {
    position: absolute; inset: 0; opacity: 0.35; pointer-events: none;
    background-image: repeating-linear-gradient(
        180deg, var(--dsi-accent-2) 0 40px, transparent 40px 76px
    );
    background-size: 6px 76px; background-repeat: repeat-y;
    left: 5%; width: 6px; transform: perspective(500px) rotateX(2deg);
    animation: lane-move 3.2s linear infinite;
    mask-image: linear-gradient(180deg, transparent, black 20%, black 80%, transparent);
}
.road-lines.r2 { left: auto; right: 5%; animation-duration: 3.6s; }
@keyframes lane-move { from { background-position-y: 0; } to { background-position-y: 76px; } }

.brand-mark { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 2rem; letter-spacing: -0.02em; position: relative; z-index: 1; }
.brand-sub { color: var(--dsi-text-dim); font-size: 0.95rem; margin-top: 0.35rem; position: relative; z-index: 1; }
.brand-tagline { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1.6rem; line-height: 1.35; margin-top: 2.5rem; position: relative; z-index: 1; }
.brand-features { margin-top: 2.25rem; display: flex; flex-direction: column; gap: 0.75rem; position: relative; z-index: 1; }
.brand-feature { display: flex; align-items: center; gap: 0.6rem; color: var(--dsi-text-dim); font-size: 0.875rem; }
.brand-feature .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dsi-accent-2); flex-shrink: 0; }

.form-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.form-card { width: 100%; max-width: 380px; }
.form-card h1 { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1.5rem; margin: 0 0 0.35rem; }
.form-card p.sub { color: var(--dsi-text-dim); font-size: 0.9rem; margin: 0 0 1.75rem; }

.signup-card {
    width: 100%; max-width: 440px; background: var(--dsi-panel);
    border: 1px solid var(--dsi-border); border-radius: 1rem; padding: 2.25rem;
}
.signup-card h1 { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1.35rem; margin: 1.5rem 0 0.3rem; }
.signup-card p.sub { color: var(--dsi-text-dim); font-size: 0.88rem; margin: 0 0 1.5rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }

/* Shared label/input styling for auth forms (login + signup) */
.form-panel label, .signup-card label {
    display: block; font-size: 0.8rem; font-weight: 500; color: var(--dsi-text-dim);
    margin-bottom: 0.4rem; margin-top: 1rem;
}
.form-panel input, .signup-card input {
    width: 100%; background: var(--dsi-surface); border: 1px solid var(--dsi-border);
    border-radius: 0.55rem; padding: 0.68rem 0.8rem; font-size: 0.92rem; color: var(--dsi-text);
    font-family: inherit;
}
.form-panel input:focus, .signup-card input:focus {
    outline: none; border-color: var(--dsi-accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}
.form-panel button[type="submit"], .signup-card button[type="submit"] {
    width: 100%; margin-top: 1.6rem; background: var(--dsi-accent); color: #fff; border: none;
    border-radius: 0.55rem; padding: 0.73rem; font-size: 0.93rem; font-weight: 600; font-family: inherit; cursor: pointer;
}
.form-panel button[type="submit"]:hover, .signup-card button[type="submit"]:hover { filter: brightness(1.08); }

.error-box, .success-box {
    font-size: 0.84rem; padding: 0.62rem 0.82rem; border-radius: 0.5rem; margin: 1rem 0 0.5rem;
}
.error-box   { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--dsi-danger); }
.success-box { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); color: var(--dsi-success); }

.form-links { margin-top: 1.5rem; text-align: center; font-size: 0.85rem; color: var(--dsi-text-dim); }
.form-links a { color: var(--dsi-accent-2); text-decoration: none; font-weight: 500; }
.form-links a:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .brand-panel { display: none; }
    .form-panel { padding: 1.25rem; }
}
@media (max-width: 480px) {
    .signup-card { padding: 1.5rem; }
    .row-2 { grid-template-columns: 1fr; }
}
