/* =====================================================
   CASE — Auth Pages (login.php / register.php)
   Split layout: left brand panel + right form
   ===================================================== */
:root {
    --blue:       #242d4c;
    --blue-grad:  linear-gradient(135deg, #1a2037 0%, #242d4c 55%, #3d4b7c 100%);
    --ink-900:    #0A0F1E;
    --ink-700:    #1E293B;
    --ink-500:    #475569;
    --ink-300:    #94A3B8;
    --ink-100:    #E2E8F0;
    --ink-50:     #F8FAFC;
    --white:      #FFFFFF;
    --red:        #EF4444;
    --green:      #22C55E;
    --shadow-lg:  0 20px 60px rgba(10,15,30,.12);
    --r:          12px;
    --t:          .25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; height:100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--ink-50);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────── */
.auth-layout {
    display: grid;
    grid-template-columns: 480px 1fr;
    min-height: 100vh;
}

/* ── Left panel ──────────────────────────────────────── */
.auth-left {
    background: var(--blue-grad);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 40px 48px;
    min-height: 100vh;
}

/* Decorative circles */
.deco-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.12);
}
.deco-1 { width: 500px; height: 500px; top: -180px; right: -180px; }
.deco-2 { width: 340px; height: 340px; bottom: -80px; left: -100px; }
.deco-3 { width: 220px; height: 220px; top: 45%; left: 30%; background: rgba(255,255,255,.04); }

/* Brand */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative; z-index: 1;
}
.brand-icon {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.2);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px; font-weight: 900;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.3);
}
.brand-name { font-size: 22px; font-weight: 800; color: white; letter-spacing: -.5px; }

/* Content */
.auth-left-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative; z-index: 1;
}
.auth-quote {
    font-size: 22px;
    font-weight: 600;
    color: rgba(255,255,255,.92);
    line-height: 1.45;
    letter-spacing: -.3px;
    margin-bottom: 12px;
    font-style: italic;
}
.auth-quote-author {
    font-size: 14px;
    color: rgba(255,255,255,.5);
    margin-bottom: 52px;
}

/* Stats */
.auth-left-stats {
    display: flex; gap: 0;
    background: rgba(255,255,255,.1);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.15);
    overflow: hidden;
    backdrop-filter: blur(8px);
}
.als-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    border-right: 1px solid rgba(255,255,255,.12);
}
.als-item:last-child { border-right: none; }
.als-num   { font-size: 22px; font-weight: 900; color: white; letter-spacing: -1px; line-height: 1; }
.als-label { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 4px; text-align: center; font-weight: 500; }

/* Register left variant */
.auth-left-title {
    font-size: 32px;
    font-weight: 800;
    color: white;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 16px;
}
.auth-left-desc {
    font-size: 15px;
    color: rgba(255,255,255,.7);
    line-height: 1.65;
    margin-bottom: 36px;
}
.auth-left-benefits {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.auth-left-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    color: rgba(255,255,255,.85);
    font-weight: 500;
}
.benefit-icon {
    width: 26px; height: 26px; flex-shrink: 0;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
}

.auth-left-copy {
    font-size: 12px;
    color: rgba(255,255,255,.3);
    position: relative; z-index: 1;
}

/* ── Right panel ─────────────────────────────────────── */
.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--white);
}
.auth-right--scroll {
    align-items: flex-start;
    overflow-y: auto;
}

.auth-form-wrap {
    width: 100%;
    max-width: 420px;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-300);
    text-decoration: none;
    margin-bottom: 40px;
    transition: color var(--t);
}
.back-link:hover { color: var(--blue); }

/* Form header */
.form-header { margin-bottom: 32px; }
.form-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--ink-900);
    letter-spacing: -.7px;
    margin-bottom: 6px;
}
.form-header p { font-size: 14.5px; color: var(--ink-300); }

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}
.alert--error   { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.alert--success { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }
.alert--info    { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }

/* ── Form fields ─────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 4px; }

.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field-group--err .field-wrap { border-color: var(--red) !important; }
.field-group--err .field-inp  { color: var(--ink-900); }

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-500);
    letter-spacing: .1px;
}

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--ink-50);
    border: 1.5px solid var(--ink-100);
    border-radius: var(--r);
    transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.field-wrap:focus-within {
    border-color: var(--blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(36, 45, 76, .08);
}
.field-ico {
    position: absolute;
    left: 14px;
    color: var(--ink-300);
    flex-shrink: 0;
    pointer-events: none;
    z-index: 1;
}

.field-inp {
    width: 100%;
    padding: 13px 44px 13px 44px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--ink-900);
    -webkit-appearance: none;
}
.field-inp::placeholder { color: var(--ink-300); }

/* Custom Select Dropdown */
.custom-select-wrap {
    position: relative;
    user-select: none;
}
.custom-select-trigger {
    display: flex;
    align-items: center;
    background: var(--ink-50);
    border: 1.5px solid var(--ink-100);
    border-radius: var(--r);
    padding: 13px 44px;
    cursor: pointer;
    transition: all var(--t);
    position: relative;
    min-height: 48px;
}
.custom-select-trigger:focus,
.custom-select-wrap.open .custom-select-trigger {
    background: white;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36, 45, 76, .08);
    outline: none;
}
.select-value {
    font-size: 14.5px;
    color: var(--ink-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 16px;
}
.select-arrow {
    position: absolute;
    right: 14px;
    color: var(--ink-500);
    transition: transform var(--t);
}
.custom-select-wrap.open .select-arrow {
    transform: rotate(180deg);
}
.custom-select-drop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--ink-100);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all .2s;
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.custom-select-wrap.open .custom-select-drop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.select-search-wrap {
    padding: 12px;
    border-bottom: 1px solid var(--ink-100);
    position: relative;
    display: flex;
    align-items: center;
}
.search-ico {
    position: absolute;
    left: 24px;
    color: var(--ink-300);
}
.select-search {
    width: 100%;
    padding: 10px 10px 10px 36px;
    border: 1px solid var(--ink-100);
    border-radius: 8px;
    font-size: 13.5px;
    outline: none;
    transition: border-color var(--t);
    font-family: inherit;
}
.select-search:focus {
    border-color: var(--blue);
}
.select-options {
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
}
.select-options::-webkit-scrollbar {
    width: 6px;
}
.select-options::-webkit-scrollbar-thumb {
    background: var(--ink-100);
    border-radius: 6px;
}
.select-option {
    padding: 10px 12px;
    font-size: 14px;
    color: var(--ink-700);
    cursor: pointer;
    border-radius: 6px;
    transition: background var(--t);
}
.select-option:hover {
    background: var(--ink-50);
}
.select-option.selected {
    background: var(--blue);
    color: white;
    font-weight: 500;
}
.select-option.hidden {
    display: none;
}

/* Eye button */
.eye-btn {
    position: absolute;
    right: 12px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-300);
    border-radius: 8px;
    transition: all var(--t);
    flex-shrink: 0;
}
.eye-btn:hover { color: var(--blue); background: var(--ink-50); }

.field-err { font-size: 12.5px; color: var(--red); font-weight: 500; }

/* Password strength meter */
.password-strength { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ps-bars { display: flex; gap: 4px; }
.ps-bar { width: 36px; height: 4px; background: var(--ink-100); border-radius: 4px; transition: background var(--t); }
.ps-label { font-size: 11.5px; color: var(--ink-300); font-weight: 500; }

/* Strength states */
.ps-weak   .ps-bar:nth-child(1) { background: var(--red); }
.ps-fair   .ps-bar:nth-child(-n+2) { background: #F59E0B; }
.ps-good   .ps-bar:nth-child(-n+3) { background: #3B82F6; }
.ps-strong .ps-bar { background: var(--green); }

/* ── Remember me ─────────────────────────────────────── */
.form-row-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 24px;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--ink-500);
    user-select: none;
}
.check-real { display: none; }
.check-ui {
    width: 18px; height: 18px;
    border: 1.5px solid var(--ink-100);
    border-radius: 5px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: white;
    transition: all var(--t);
}
.check-real:checked + .check-ui {
    background: var(--blue);
    border-color: var(--blue);
}
.check-real:checked + .check-ui::after {
    content: '';
    display: block;
    width: 10px; height: 6px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translate(1px, -1px);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 15px;
    background: var(--blue-grad);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--r);
    border: none;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 6px 20px rgba(36, 45, 76, .3);
    transition: transform var(--t), box-shadow var(--t);
    margin-top: 4px;
    margin-bottom: 20px;
}
.btn-submit:hover   { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(36, 45, 76, .4); }
.btn-submit:active  { transform: translateY(0); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.link-blue { color: var(--blue); font-weight: 600; font-size: 13.5px; text-decoration: none; transition: opacity var(--t); }
.link-blue:hover { opacity: .75; }

.form-switch { font-size: 14px; color: var(--ink-300); text-align: center; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-left {
        min-height: auto;
        padding: 32px 28px 40px;
    }
    .auth-left-content { justify-content: flex-start; padding: 32px 0; }
    .auth-quote { font-size: 18px; }
    .auth-right { padding: 32px 24px; }
    .auth-form-wrap { max-width: 100%; }
}
@media (max-width: 480px) {
    .auth-left { padding: 24px 20px 32px; }
    .auth-right { padding: 24px 18px; }
    .form-header h1 { font-size: 24px; }
}
