/* Motion system — tokens + reduced-motion, for pages that do not extend a
   layout (auth, landing). @import must precede all rules. Component presets
   defer to this file's own rules by load order, but the tokens and the
   reduced-motion guards (which use !important) still apply. */
@import url('motion.css');

/* ZamSkools — modern split-screen auth design (Ontech/ICTM design language,
   themed in the ZamSkools green). Shared by every login page + registration.
   Loaded via url_for('static', ...) so it needs no CSP nonce. */

:root {
    --primary: #1a5928;
    --primary-hover: #16481f;
    --primary-dark: #0d2818;
    --primary-light: #ecfdf5;
    --accent: #10b981;
    --accent-2: #4ade80;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --border-light: #e2e8f0;
    --shadow-lg: 0 20px 60px -12px rgb(0 0 0 / 0.15);
    --danger: #c0392b;
}

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

body {
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--gray-50);
}

/* ── Split layout ── */
.auth-split { display: flex; min-height: 100vh; }

/* ── Left branding panel ── */
.brand-panel {
    flex: 1;
    background: linear-gradient(135deg, #0d2818 0%, #071a0f 50%, #113322 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
.brand-panel::before,
.brand-panel::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.09;
    animation: floatOrb 20s ease-in-out infinite;
}
.brand-panel::before {
    width: 520px; height: 520px;
    background: var(--accent-2);
    top: -160px; right: -110px;
}
.brand-panel::after {
    width: 420px; height: 420px;
    background: var(--accent);
    bottom: -110px; left: -90px;
    animation-delay: -10s;
    animation-direction: reverse;
}
@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.brand-content { position: relative; z-index: 2; max-width: 480px; animation: slideRight 0.6s ease-out; }
.brand-content .logo-area { margin-bottom: 2.5rem; display: flex; align-items: center; gap: 0.75rem; }
.brand-content .logo-area img { height: 44px; width: auto; }
.brand-content .logo-word {
    font-size: 1.4rem; font-weight: 800; color: #fff; letter-spacing: -0.02em;
}
.brand-content .logo-word span {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.brand-content h1 {
    font-size: 2.25rem; font-weight: 800; color: #fff;
    line-height: 1.2; margin-bottom: 0.75rem; letter-spacing: -0.03em;
}
.brand-content h1 span {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.brand-content .tagline {
    font-size: 1.05rem; color: rgba(255,255,255,0.6); line-height: 1.6; margin-bottom: 2.5rem;
}

.feature-list { display: flex; flex-direction: column; gap: 1rem; }
.feature-item {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.875rem 1rem; border-radius: 12px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(4px); transition: all 0.3s;
    animation: fadeInUp 0.5s ease-out both;
}
.feature-item:hover { background: rgba(255,255,255,0.08); transform: translateX(4px); }
.feature-item:nth-child(1) { animation-delay: 0.2s; }
.feature-item:nth-child(2) { animation-delay: 0.35s; }
.feature-item:nth-child(3) { animation-delay: 0.5s; }
.feature-item:nth-child(4) { animation-delay: 0.65s; }

.feature-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.feature-icon.green { background: rgba(34,197,94,0.2); color: #4ade80; }
.feature-icon.emerald { background: rgba(16,185,129,0.2); color: #34d399; }
.feature-icon.teal { background: rgba(20,184,166,0.2); color: #2dd4bf; }
.feature-icon.amber { background: rgba(245,158,11,0.2); color: #fbbf24; }

.feature-text h4 { font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.9); margin-bottom: 2px; }
.feature-text p { font-size: 0.75rem; color: rgba(255,255,255,0.45); margin: 0; }

.brand-stats {
    display: flex; gap: 2rem; margin-top: 2.5rem; padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08); position: relative; z-index: 2;
}
.brand-stat .stat-value { font-size: 1.5rem; font-weight: 700; color: #fff; }
.brand-stat .stat-label {
    font-size: 0.7rem; color: rgba(255,255,255,0.4);
    text-transform: uppercase; letter-spacing: 0.05em;
}

/* ── Right form panel ── */
.form-panel {
    width: 480px; flex-shrink: 0;
    display: flex; flex-direction: column; justify-content: center;
    padding: 3rem; background: #ffffff;
}
.form-container { width: 100%; max-width: 380px; margin: 0 auto; animation: slideUp 0.5s ease-out; }
.form-panel.wide .form-container { max-width: 560px; }

.form-brand-mini { display: none; align-items: center; gap: 0.6rem; margin-bottom: 1.5rem; }
.form-brand-mini img { height: 34px; }
.form-brand-mini .w { font-weight: 800; color: var(--primary); font-size: 1.15rem; }

.role-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.7rem; border-radius: 999px;
    background: var(--primary-light); color: var(--primary);
    font-size: 0.72rem; font-weight: 600; margin-bottom: 0.9rem;
}
.form-header { margin-bottom: 2rem; }
.form-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.form-header p { color: var(--text-secondary); font-size: 0.875rem; margin: 0; }

.form-label { font-weight: 500; color: var(--text-primary); margin-bottom: 6px; font-size: 0.85rem; }
.form-control, .form-select {
    border: 1.5px solid var(--border-light); border-radius: 10px;
    padding: 11px 14px; font-size: 0.9rem; color: var(--text-primary);
    background: #fff; transition: all 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,89,40,0.12); outline: none;
}
.form-control::placeholder { color: var(--text-muted); }

.input-group-text {
    background: var(--gray-50); border: 1.5px solid var(--border-light); border-right: none;
    border-radius: 10px 0 0 10px; color: var(--text-muted); padding: 11px 14px;
}
.input-group .form-control { border-left: none; border-radius: 0 10px 10px 0; }
.input-group:focus-within .input-group-text { border-color: var(--primary); color: var(--primary); }

.btn-auth {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border: none; padding: 12px 16px; font-size: 0.9rem; font-weight: 600;
    border-radius: 10px; transition: all 0.3s; width: 100%;
}
.btn-auth:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-dark));
    color: #fff; box-shadow: 0 8px 24px rgba(26,89,40,0.35); transform: translateY(-1px);
}
.btn-auth:active { transform: translateY(0) scale(0.98); }
.btn-auth:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-auth .spinner { display: none; }
.btn-auth.loading .spinner { display: inline-block; }
.btn-auth.loading .text { display: none; }

.btn-outline-auth {
    background: #fff; color: var(--primary); border: 1.5px solid var(--border-light);
    padding: 11px 16px; font-weight: 600; border-radius: 10px; transition: all 0.2s;
}
.btn-outline-auth:hover { border-color: var(--primary); background: var(--primary-light); }

.password-toggle {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    cursor: pointer; color: var(--text-muted); z-index: 10; transition: color 0.2s;
}
.password-toggle:hover { color: var(--primary); }

.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-label { font-size: 0.85rem; color: var(--text-secondary); }
.link-primary-auth { color: var(--primary); text-decoration: none; font-weight: 500; font-size: 0.85rem; }
.link-primary-auth:hover { text-decoration: underline; }

.alert { border-radius: 10px; border: 1px solid; padding: 10px 14px; margin-bottom: 1rem; font-size: 0.85rem; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--primary-light); color: #166534; border-color: #bbf7d0; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

.auth-divider {
    display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0;
    color: var(--text-muted); font-size: 0.75rem;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }

.security-badge {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem; border-radius: 10px; background: var(--gray-50); border: 1px solid var(--border-light);
}
.security-badge i { color: #22c55e; }
.security-badge span { font-size: 0.75rem; color: var(--text-muted); }

.form-footer { text-align: center; margin-top: 1.5rem; font-size: 0.8rem; color: var(--text-muted); }
.form-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* role switch chips (login as ...) */
.role-switch { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; justify-content: center; }
.role-switch a {
    font-size: 0.72rem; color: var(--text-secondary); text-decoration: none;
    padding: 0.3rem 0.7rem; border: 1px solid var(--border-light); border-radius: 999px; transition: all 0.2s;
}
.role-switch a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ── Responsive ── */
@media (max-width: 992px) {
    .brand-panel { display: none; }
    .form-panel { width: 100%; min-height: 100vh; }
    .form-brand-mini { display: flex; }
}
@media (max-width: 480px) {
    .form-panel { padding: 2rem 1.25rem; }
}

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
