:root {
    --glass: rgba(94, 63, 56, 0.58);
    --glass-border: rgba(255, 255, 255, 0.22);
    --accent: #1e66ff;
    --accent-dark: #0f4dda;
    --accent-glow: rgba(30, 102, 255, 0.45);
    --faculty: #7c5cff;
    --faculty-dark: #5a3fe0;
    --faculty-glow: rgba(124, 92, 255, 0.4);
    --danger-bg: rgba(220, 53, 69, 0.92);
    --success-bg: rgba(25, 135, 84, 0.92);
    --text-soft: rgba(255, 255, 255, 0.88);
}

*, *::before, *::after { box-sizing: border-box; }

body.auth-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: "Work Sans", system-ui, sans-serif;
    color: #fff;
    background: #0e1018 url("../admin/uploads/images/bg (1).jpg") no-repeat center center / cover fixed;
    position: relative;
}

body.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(30, 102, 255, 0.18), transparent 55%),
        linear-gradient(180deg, rgba(8, 14, 24, 0.4) 0%, rgba(10, 10, 10, 0.5) 45%, rgba(20, 12, 10, 0.65) 100%);
    pointer-events: none;
}

body.auth-page.faculty-theme::before {
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 92, 255, 0.2), transparent 55%),
        linear-gradient(180deg, rgba(8, 14, 24, 0.4) 0%, rgba(10, 10, 10, 0.5) 45%, rgba(20, 12, 10, 0.65) 100%);
}

.back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #1b1b1b;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.back-link:hover {
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

body.auth-page.faculty-theme .back-link:hover {
    color: var(--faculty);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 28px 26px 24px;
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    background: linear-gradient(165deg, var(--glass) 0%, rgba(77, 49, 44, 0.82) 100%);
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: auth-rise 0.55s ease-out;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand {
    text-align: center;
    margin-bottom: 20px;
}

.logo-ring {
    width: 88px;
    height: 88px;
    margin: 0 auto 12px;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(145deg, #fff 0%, #e8e8e8 100%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.logo-ring img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    display: block;
}

.title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: 0.02em;
}

.subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-soft);
    font-weight: 500;
    line-height: 1.4;
}

.alert-pill {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    margin-bottom: 16px;
    line-height: 1.4;
}

.alert-pill.danger {
    background: var(--danger-bg);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.alert-pill.success {
    background: var(--success-bg);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.alert-pill i {
    margin-top: 2px;
    flex-shrink: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.form-grid .field.full {
    grid-column: 1 / -1;
}

.field {
    margin-bottom: 12px;
    text-align: left;
}

.field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 5px;
    padding-left: 2px;
}

.field label .req {
    color: #ffb4b4;
}

.input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    padding: 0 12px;
    min-height: 46px;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

body.auth-page.faculty-theme .input-wrap:focus-within {
    border-color: var(--faculty);
    box-shadow: 0 0 0 4px var(--faculty-glow);
}

.input-wrap i.field-icon {
    color: #444;
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.input-wrap input,
.input-wrap select {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: #1a1a1a;
    padding: 10px 0;
    min-width: 0;
    width: 100%;
}

.input-wrap select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23444' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 22px;
}

.input-wrap input::placeholder {
    color: #888;
}

.toggle-pass {
    border: 0;
    background: transparent;
    color: #555;
    padding: 6px;
    cursor: pointer;
    border-radius: 8px;
    line-height: 1;
}

.toggle-pass:hover {
    color: var(--accent);
    background: rgba(30, 102, 255, 0.1);
}

body.auth-page.faculty-theme .toggle-pass:hover {
    color: var(--faculty);
    background: rgba(124, 92, 255, 0.12);
}

.hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    margin: -4px 0 10px 2px;
}

.btn-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    padding: 14px 20px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(30, 102, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

body.auth-page.faculty-theme .btn-submit {
    background: linear-gradient(135deg, var(--faculty) 0%, var(--faculty-dark) 100%);
    box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-submit:disabled {
    opacity: 0.75;
    cursor: wait;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
}

.signin-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    background: rgba(107, 255, 59, 0.15);
    border: 1px solid rgba(107, 255, 59, 0.45);
    color: #b8ff9a;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.signin-link:hover {
    background: rgba(107, 255, 59, 0.28);
    color: #d4ffc4;
    transform: translateY(-1px);
}

.footer-note {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 520px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .auth-shell { padding: 24px 18px 20px; }
    .back-link { top: 14px; left: 14px; }
}
