/* ============================================================
   PKK CRM — login.css
   ============================================================ */

/* ─── SELF-HOSTED INTER FONT ─── */
@font-face {
    font-family: 'Inter';
    src: url('../webfonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../webfonts/Inter-Medium.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../webfonts/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../webfonts/Inter-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}

/* SYSTEM FONTS FALLBACK - Works offline everywhere */
* {
    font-family: 'Inter', system-ui, -apple-system,
                 'Segoe UI', 'Noto Sans', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
}


:root {
    --primary:         #1e3872;
    --primary-dark:    #162a58;
    --primary-light:   #2a4d9e;
    --secondary:       #509851;
    --secondary-dark:  #3d7a3e;
    --secondary-light: #65b566;

    --neutral:         #eaebec;
    --neutral-dark:    #d0d2d4;
    --neutral-light:   #f5f5f6;
    --gradient:        linear-gradient(135deg, #1e3872 0%, #509851 100%);
    --gradient-soft:   linear-gradient(135deg, rgba(30,56,114,0.08) 0%, rgba(80,152,81,0.08) 100%);

    --white:           #ffffff;
    --bg:              #f8f9fc;
    --bg-soft:         #f8f9fc;
    --bg-card:         #ffffff;
    --border:          #e8eaf0;
    --border-focus:     #509851;
    --border-hover:     rgba(30,56,114,0.35);

    --text-primary:    #1a1d2e;
    --text-secondary:  #5a607a;
    --text-muted:      #9398b0;

    --shadow-sm:       0 2px 8px rgba(30,56,114,0.08);
    --shadow-md:       0 4px 24px rgba(30,56,114,0.12);
    --shadow-lg:       0 8px 40px rgba(30,56,114,0.16);
    --shadow-primary:  0 8px 32px rgba(30,56,114,0.28);
    --shadow-secondary:   0 8px 32px rgba(80,152,81,0.28);

    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  18px;
    --radius-xl:  24px;
}


*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══════════════════════════════════════════
   PAGE LAYOUT
══════════════════════════════════════════ */
.login-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ══════════════════════════════════════════
   LEFT PANEL
══════════════════════════════════════════ */
.login-left {
    background: var(--gradient);
    display: flex; flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    position: relative; overflow: hidden;
}
.login-left::before {
    content: '';
    position: absolute; top: -80px; right: -80px;
    width: 320px; height: 320px; border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.login-left::after {
    content: '';
    position: absolute; bottom: -100px; left: -60px;
    width: 380px; height: 380px; border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

.left-brand {
    display: flex; align-items: center; gap: 12px;
    position: relative; z-index: 1;
}
.left-brand-logo {
    height: 44px; width: auto; object-fit: contain;
    /* REMOVED filter - keep original logo colors */
    background: #ffffff;
    padding: 6px 8px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.left-brand-name {
    font-size: 20px; font-weight: 700;
    color: #fff; 
    letter-spacing: -0.01em;
}

.left-content { position: relative; z-index: 1; }

.left-tag {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 14px; border-radius: 100px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 12px; font-weight: 600; color: #fff;
    margin-bottom: 24px; letter-spacing: 0.05em;
}
.left-tag i { font-size: 11px; }

.left-title {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700; color: #fff;
    line-height: 1.15; letter-spacing: -0.02em;
    margin-bottom: 16px;
}
.left-sub {
    font-size: 14px; color: rgba(255,255,255,0.75);
    line-height: 1.7; max-width: 340px;
    margin-bottom: 36px;
}

.left-features { display: flex; flex-direction: column; gap: 14px; }
.left-feature { display: flex; align-items: center; gap: 12px; }
.left-feature-icon {
    width: 34px; height: 34px; border-radius: 9px;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #fff; flex-shrink: 0;
}
.left-feature-text {
    font-size: 13px; color: rgba(255,255,255,0.85); font-weight: 500;
}

.left-footer {
    position: relative; z-index: 1;
    font-size: 12px; color: rgba(255,255,255,0.45);
}

/* ══════════════════════════════════════════
   RIGHT PANEL
══════════════════════════════════════════ */
.login-right {
    background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    padding: 48px 5%;
    overflow-y: auto;
}

.login-form-wrap { width: 100%; max-width: 420px; }

.form-header { margin-bottom: 32px; }
.form-header-top {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.form-back {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 500; color: var(--text-muted);
    transition: color 0.2s;
}
.form-back:hover { color: var(--secondary); }
.form-back i { font-size: 11px; }

.form-step-label {
    font-size: 11px; font-weight: 600;
    color: var(--secondary); letter-spacing: 0.1em;
    text-transform: uppercase;
}
.form-title {
    font-size: 26px; font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em; margin-bottom: 6px;
}
.form-sub { font-size: 14px; color: var(--text-secondary); }

/* ─── ALERTS ─── */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-md);
    font-size: 13px; font-weight: 500;
    margin-bottom: 20px; line-height: 1.5;
}
.alert i { font-size: 14px; margin-top: 1px; flex-shrink: 0; }
.alert-error   { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.2);  color: #ef4444; }
.alert-success { background: rgba(34,197,94,0.08);  border: 1px solid rgba(34,197,94,0.2);  color: #16a34a; }
.alert-warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); color: #d97706; }
.alert-info    { background: rgba(80,152,81,0.08); border: 1px solid rgba(80,152,81,0.2); color: var(--secondary); }

/* ─── FORM FIELDS ─── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: flex; align-items: center;
    justify-content: space-between;
    font-size: 13px; font-weight: 600;
    color: var(--text-primary); margin-bottom: 7px;
}
.form-label-hint {
    font-size: 11px; font-weight: 400; color: var(--text-muted);
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon {
    position: absolute; left: 14px;
    font-size: 14px; color: var(--text-muted);
    pointer-events: none; transition: color 0.2s;
}
.input-wrap:focus-within .input-icon { color: var(--secondary); }

.form-control {
    width: 100%; height: 48px;
    padding: 0 44px 0 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);

    font-size: 14px; color: var(--text-primary);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-control::placeholder { color: var(--text-muted); font-size: 13px; }
.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(80,152,81,0.1);
}
.form-control.is-error { border-color: #ef4444; }
.form-control.is-error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

.input-toggle {
    position: absolute; right: 14px;
    background: none; border: none;
    cursor: pointer; padding: 4px;
    color: var(--text-muted); font-size: 14px;
    transition: color 0.2s;
}
.input-toggle:hover { color: var(--secondary); }

.field-error {
    font-size: 11px; color: #ef4444;
    margin-top: 5px; display: none;
    align-items: center; gap: 4px;
}
.field-error.show { display: flex; }

/* ─── LOCK WARNING ─── */
.lock-info {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}
.lock-info i { color: #d97706; font-size: 16px; flex-shrink: 0; }
.lock-info-text { font-size: 13px; color: #92400e; line-height: 1.5; }
.lock-info-text strong { color: #d97706; }

/* ─── SUBMIT BUTTON ─── */
.btn-submit {
    width: 100%; height: 50px;
    background: var(--gradient);
    color: #fff; border: none;
    border-radius: var(--radius-md);

    font-size: 15px; font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.2s;
    box-shadow: var(--shadow-secondary);
    margin-top: 24px;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(80,152,81,0.4); }
.btn-submit:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.btn-submit .spinner {
    display: none;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── FOOTER NOTE ─── */
.form-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 22px 0; font-size: 12px; color: var(--text-muted);
}
.form-divider::before,
.form-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.form-footer-note {
    text-align: center; margin-top: 20px;
    font-size: 13px; color: var(--text-muted);
}
.form-footer-note a {
    color: var(--secondary); font-weight: 600; transition: opacity 0.2s;
}
.form-footer-note a:hover { opacity: 0.8; }


/* ══════════════════════════════════════════
   OTP PAGE SPECIFIC
══════════════════════════════════════════ */
.otp-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* OTP digit boxes */
.otp-inputs {
    display: flex; gap: 10px;
    justify-content: center;
    margin: 8px 0;
}
.otp-digit {
    width: 52px; height: 58px;
    text-align: center;
    font-size: 22px; font-weight: 700;
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    caret-color: var(--secondary);
}
.otp-digit:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(80,152,81,0.1);
}
.otp-digit.is-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.otp-digit.is-filled {
    border-color: var(--secondary);
    background: rgba(80,152,81,0.03);
}

/* Email hint */
.otp-email-hint {
    text-align: center;
    font-size: 13px; color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.6;
}
.otp-email-hint strong {
    color: var(--text-primary); font-weight: 600;
}

/* Resend row */
.otp-resend-row {
    display: flex; align-items: center;
    justify-content: center; gap: 6px;
    margin-top: 20px;
    font-size: 13px; color: var(--text-muted);
}
.btn-resend {
    background: none; border: none; cursor: pointer;

    font-size: 13px; font-weight: 600;
    color: var(--secondary);
    padding: 0; transition: opacity 0.2s;
}
.btn-resend:hover { opacity: 0.8; }
.btn-resend:disabled {
    color: var(--text-muted);
    cursor: not-allowed; opacity: 1;
}

/* OTP countdown timer */
.otp-timer {
    font-size: 13px; font-weight: 600;
    color: var(--secondary);
}

/* OTP attempt warning */
.otp-attempts-left {
    text-align: center;
    font-size: 12px; color: #d97706;
    margin-top: 10px;
    display: flex; align-items: center;
    justify-content: center; gap: 5px;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
    .login-page,
    .otp-page { grid-template-columns: 1fr; }
    .login-left,
    .otp-left  { display: none; }
    .login-right,
    .otp-right { padding: 40px 6%; }
}
@media (max-width: 480px) {
    .login-right,
    .otp-right { padding: 32px 5%; }
    .otp-digit { width: 44px; height: 52px; font-size: 18px; }
}

/* Mobile brand (hidden on desktop) */
.mobile-brand {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.mobile-brand img {
    height: 34px;
    width: auto;
}

.mobile-brand span {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
}

/* Show only on mobile */
@media (max-width: 900px) {
    .mobile-brand {
        display: flex;
    }
}

.alert-warning {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    color: #d97706;
}

.resend-left-label {
    font-size: 12px;
    color: var(--text-muted);
}