/* ═══════════════════════════════════════════════════
   LOGIN PAGE CSS — index.css
   Include: <link href="index.css" rel="stylesheet">
═══════════════════════════════════════════════════ */

/* ── Shared Tokens (also used by sidebar.css) ── */
:root {
    --c-dark:   #3D1A08;
    --c-mid:    #5C2A10;
    --c-lt:     #8B6050;
    --c-border: #D0C0B0;
    --c-input:  #FAF6F3;
    --gold-lt:  #E8B84A;
    --gold-glow:#FFD97A;
    --gold:     #C8922A;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Lato', sans-serif;
    overflow: hidden;
    background: #3A160A;
}

/* ── Page Layout ── */
.erp-page {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ── Main Area ── */
.erp-main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
    background-image: url('../images/pdea1img.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(160deg,
        rgba(50, 20, 5, 0.60) 0%,
        rgba(30, 12, 3, 0.45) 50%,
        rgba(50, 20, 5, 0.55) 100%);
}

/* ── Login Card ── */
.login-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    width: 430px;
    max-width: 100%;
    max-height: 94vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.2),
                inset 0 1px 0 rgba(255,255,255,0.3);
    animation: cardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(32px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card::-webkit-scrollbar { width: 4px; }
.login-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.card-topbar {
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), rgba(255,255,255,0.8), rgba(255,255,255,0.5), transparent);
    border-radius: 20px 20px 0 0;
}

.card-inner { padding: 20px 30px 18px; }

/* ── Card Header ── */
.card-hd { text-align: center; margin-bottom: 16px; }

.card-crest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-dark), var(--c-mid));
    border: 2px solid var(--gold-lt);
    box-shadow: 0 4px 16px rgba(11,29,58,0.3), 0 0 0 4px rgba(200,146,42,0.1);
    margin-bottom: 10px;
    animation: crestPulse 3s ease-in-out infinite;
}
@keyframes crestPulse {
    0%,100% { box-shadow: 0 4px 16px rgba(11,29,58,0.3), 0 0 0 4px rgba(200,146,42,0.1); }
    50%     { box-shadow: 0 4px 20px rgba(11,29,58,0.4), 0 0 0 7px rgba(200,146,42,0.2); }
}
.card-crest svg { width: 20px; height: 20px; fill: var(--gold-glow); }

.card-hd h3 {
    font-family: 'Merriweather', serif;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.card-hd p { font-size: 11.5px; color: rgba(255,255,255,0.7); }

/* ── Alerts ── */
.erp-alert {
    padding: 9px 13px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
    animation: fadeDn 0.3s ease both;
}
@keyframes fadeDn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.erp-alert-danger  { background: #FFF5F5; color: #9B1C1C; border: 1px solid #FCA5A5; }
.erp-alert-success { background: #F0FDF4; color: #14532D; border: 1px solid #86EFAC; }
.erp-alert-warning { background: #FFFBEB; color: #78350F; border: 1px solid #FCD34D; }

/* ── Role Tabs ── */
.role-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.role-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px 9px;
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    transition: all 0.22s;
    position: relative;
    overflow: hidden;
}

.role-tab::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
    border-radius: 0 0 10px 10px;
    transition: background 0.22s;
}

.role-tab::before {
    content: '';
    position: absolute;
    top: 5px; right: 7px;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.r-ico {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.22s;
}
.r-ico svg {
    width: 15px; height: 15px;
    stroke: rgba(255,255,255,0.7);
    fill: none; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
    transition: stroke 0.22s;
}

.role-tab span {
    font-size: 13.5px; font-weight: 1000;
    color: rgba(255,255,255,0.65);
    text-align: center; line-height: 1.4;
    transition: color 0.22s;
}

.role-tab:hover { border-color: rgba(255,255,255,0.38); background: rgba(255,255,255,0.14); transform: translateY(-1px); }
.role-tab:hover .r-ico { background: rgba(255,255,255,0.2); }
.role-tab:hover .r-ico svg { stroke: rgba(255,255,255,0.9); }
.role-tab:hover span { color: rgba(255,255,255,0.9); }

/* Active shared */
.role-tab.active { transform: translateY(-2px); }
.role-tab.active::before { content: '✓'; }

/* Student active */
#tab-student.active { background: rgba(44,48,16,0.95); border-color: rgba(255,217,50,0.70); box-shadow: 0 4px 22px rgba(44,48,16,0.60), inset 0 1px 0 rgba(255,255,255,0.15); }
#tab-student.active::after { background: linear-gradient(90deg, #FFD700, #FFF176, #FFD700); }
#tab-student.active .r-ico { background: linear-gradient(135deg, #FFD700, #A89200); box-shadow: 0 3px 14px rgba(255,215,0,0.55); }
#tab-student.active .r-ico svg { stroke: #1a1c06; stroke-width: 2.2; }
#tab-student.active span { color: #FFF176; font-weight: 800; }
#tab-student.active::before { color: #FFD700; }

/* Institute active */
#tab-institute.active { background: rgba(34,38,12,0.95); border-color: rgba(232,184,74,0.70); box-shadow: 0 4px 22px rgba(34,38,12,0.60), inset 0 1px 0 rgba(255,255,255,0.15); }
#tab-institute.active::after { background: linear-gradient(90deg, #E8B84A, #FFD97A, #E8B84A); }
#tab-institute.active .r-ico { background: linear-gradient(135deg, #E8B84A, #9A6A10); box-shadow: 0 3px 14px rgba(232,184,74,0.55); }
#tab-institute.active .r-ico svg { stroke: #1a1c06; stroke-width: 2.2; }
#tab-institute.active span { color: #FFD97A; font-weight: 800; }
#tab-institute.active::before { color: #E8B84A; }

/* Payment active */
#tab-payment.active { background: rgba(24,27,8,0.95); border-color: rgba(212,255,80,0.65); box-shadow: 0 4px 22px rgba(24,27,8,0.60), inset 0 1px 0 rgba(255,255,255,0.15); }
#tab-payment.active::after { background: linear-gradient(90deg, #BFFF00, #E8FF8A, #BFFF00); }
#tab-payment.active .r-ico { background: linear-gradient(135deg, #CAFF33, #7A9900); box-shadow: 0 3px 14px rgba(191,255,0,0.45); }
#tab-payment.active .r-ico svg { stroke: #1a1c06; stroke-width: 2.2; }
#tab-payment.active span { color: #E8FF8A; font-weight: 800; }
#tab-payment.active::before { color: #CAFF33; }

/* Sanstha active */
#tab-sanstha.active { background: rgba(40,34,8,0.95); border-color: rgba(255,180,30,0.70); box-shadow: 0 4px 22px rgba(40,34,8,0.60), inset 0 1px 0 rgba(255,255,255,0.15); }
#tab-sanstha.active::after { background: linear-gradient(90deg, #FFA500, #FFD97A, #FFA500); }
#tab-sanstha.active .r-ico { background: linear-gradient(135deg, #FFB830, #C87800); box-shadow: 0 3px 14px rgba(255,165,0,0.55); }
#tab-sanstha.active .r-ico svg { stroke: #1a1c06; stroke-width: 2.2; }
#tab-sanstha.active span { color: #FFD08A; font-weight: 800; }
#tab-sanstha.active::before { color: #FFB830; }

/* ── Form Panels ── */
.form-panel { display: none; }
.form-panel.active { display: block; animation: panIn 0.25s ease both; }
@keyframes panIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Section Label ── */
.sec-lbl {
    display: flex; align-items: center; gap: 8px;
    font-size: 10px; font-weight: 800; letter-spacing: 2.5px;
    text-transform: uppercase; color: #FFD97A;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    margin-bottom: 12px;
}
.sec-lbl::before, .sec-lbl::after { content: ''; flex: 1; height: 1px; background: rgba(255,220,100,0.3); }

/* ── Form Fields ── */
.fg { margin-bottom: 10px; }
.fg label {
    display: block; font-size: 10px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase;
    color: rgba(255,255,255,0.95); margin-bottom: 5px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.fw { position: relative; }
.fw .fi {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; stroke: #7A4A2A; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
    pointer-events: none; transition: stroke 0.2s; z-index: 2;
}
.fw input, .fw select {
    width: 100%; padding: 10px 12px 10px 34px;
    border: 1.5px solid rgba(255,255,255,0.35); border-radius: 9px;
    font-family: 'Lato', sans-serif; font-size: 13.5px; font-weight: 500;
    color: #2C1206; background: rgba(255,255,255,0.88);
    backdrop-filter: blur(8px); outline: none; transition: all 0.2s; appearance: none;
}
.fw input:focus, .fw select:focus {
    border-color: #7A4A2A; background: rgba(255,255,255,0.96);
    box-shadow: 0 0 0 3px rgba(122,74,42,0.2); color: #1A0A03;
}
.fw input:focus + .fi, .fw select:focus + .fi { stroke: #3D1A08; }
.fw input::placeholder { color: #A08070; font-size: 12.5px; font-weight: 400; }
.fw select option { background: #fff; color: #2C1206; }

.sel-wr::after {
    content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: #7A4A2A; font-size: 12px; pointer-events: none; z-index: 2;
}

/* ── Password Toggle ── */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 36px !important; }
.pw-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 3; opacity: 0.55; transition: opacity 0.2s;
}
.pw-toggle:hover { opacity: 1; }
.pw-toggle svg {
    width: 16px; height: 16px; stroke: #7A4A2A; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Captcha ── */
.cap-row {
    display: flex; flex-direction: row; align-items: center;
    flex-wrap: nowrap; gap: 8px; width: 100%;
}

.cap-box {
    flex: 0 0 104px; padding: 8px;
    background: rgba(61,26,8,0.7);
    border: 1px solid rgba(255,255,255,0.3); border-radius: 6px;
    text-align: center; font-family: 'Courier New', monospace;
    font-size: 17px; font-weight: 900; color: #ffffff; letter-spacing: 4px;
    cursor: pointer; user-select: none; position: relative;
    box-shadow: 0 3px 12px rgba(0,0,0,0.3); transition: transform 0.15s;
}
.cap-box:hover { transform: scale(1.02); }

.cap-hint {
    position: absolute; top: 2px; right: 5px;
    font-size: 8px; color: rgba(255,255,255,0.55); font-family: sans-serif; letter-spacing: 0;
}

.cap-in-wrap { position: relative; flex: 1; min-width: 0; }
.cap-in-wrap .cap-in { width: 100% !important; }

.cap-in {
    flex: 1; padding: 10px 12px !important;
    border: 1.5px solid rgba(255,255,255,0.35) !important; border-radius: 9px !important;
    font-family: 'Lato', sans-serif !important; font-size: 13.5px !important; font-weight: 500 !important;
    background: rgba(255,255,255,0.88) !important; backdrop-filter: blur(8px) !important;
    outline: none !important; color: #2C1206 !important; transition: all 0.2s !important;
}
.cap-in::placeholder { color: #A08070 !important; font-weight: 400 !important; }
.cap-in:focus {
    border-color: #7A4A2A !important;
    background: rgba(255,255,255,0.96) !important;
    box-shadow: 0 0 0 3px rgba(122,74,42,0.2) !important;
}

/* Captcha error state */
.cap-in.cap-error {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229,62,62,0.25) !important;
    animation: capShake 0.35s ease both;
}
@keyframes capShake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-6px); }
    40%  { transform: translateX(6px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.cap-error-msg {
    display: none;
    font-size: 11px; color: #9B1C1C; font-weight: 600;
    margin-top: 4px; padding: 4px 8px;
    background: #FFF5F5;
    border: 1px solid #FCA5A5; border-radius: 6px;
    animation: fadeDn 0.2s ease both;
}
.cap-error-msg.show { display: block; }

/* ── Submit Button ── */
.btn-sub {
    width: 100%; padding: 12px 20px; margin-top: 6px;
    background: rgba(61,26,8,0.85); color: #fff;
    border: 1px solid rgba(255,255,255,0.25); border-radius: 8px;
    font-family: 'Lato', sans-serif; font-size: 13px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
    position: relative; overflow: hidden; transition: all 0.22s;
    box-shadow: 0 4px 18px rgba(0,0,0,0.35); backdrop-filter: blur(8px);
}
.btn-sub::before {
    content: ''; position: absolute; inset: 0;
    background: rgba(92,42,16,0.9); opacity: 0; transition: opacity 0.22s;
}
.btn-sub:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.4); }
.btn-sub:hover::before { opacity: 1; }
.btn-sub:active { transform: scale(0.99); }
.btn-sub span { position: relative; z-index: 1; }

/* ── Footer Links ── */
.fl { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; }
.fl a { font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,0.9); text-decoration: none; transition: color 0.2s; }
.fl a:hover { color: #ffffff; text-decoration: underline; }
.fl .fl-dim { color: rgba(255,255,255,0.55); font-weight: 400; }

/* ── Card Footer ── */
.card-ft {
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.gpip { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.6); box-shadow: 0 0 4px rgba(255,255,255,0.3); }
.card-ft span { font-size: 10px; color: rgba(255,255,255,0.6); letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 960px) {
    html, body { overflow: auto; }
    .erp-page  { flex-direction: column; height: auto; min-height: 100vh; }
    .erp-main  { width: 100%; min-height: 100vh; padding: 70px 16px 24px; }
    .login-card { width: 100%; max-width: 460px; max-height: none; }
    .card-inner { padding: 20px 18px 16px; }
}
@media (max-width: 480px) {
    .card-inner { padding: 16px 14px 14px; }
    .card-hd h3 { font-size: 18px; }
    .role-tab   { padding: 7px 4px; }
    .r-ico      { width: 28px; height: 28px; }
    .role-tab span { font-size: 10px; }
}
