/* =====================================================
   DocIndia Admin — Login Page Styles
   Loaded ONLY on login/auth pages via @section pageCss
   Depends on: admin-base.css (must load first)
   Contains: auth layout, form fields, submit button,
             error alert, animations
   ===================================================== */

/* ── AUTH PAGE LAYOUT ───────────────────────────────── */
.auth-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ── AUTH PANEL (Left) ──────────────────────────────── */
.auth-panel {
    background: var(--panel-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 3rem;
    position: relative;
    overflow: hidden;
}

/* Dot grid pattern */
.auth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

/* Bottom-right glow */
.auth-panel::after {
    content: '';
    position: absolute;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
    bottom: -100px; right: -80px;
    pointer-events: none;
    z-index: 0;
}

.auth-panel__glow {
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    top: -80px; left: -60px;
    pointer-events: none;
    z-index: 0;
}

.auth-panel__center {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.125rem;
    text-align: center;
}

.auth-panel__brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo always white on dark panel */
.auth-panel .brand-logo__img   { filter: brightness(0) invert(1); }
.auth-panel .brand-logo__badge {
    background: rgba(255, 255, 255, 0.1);
    color: #93c5fd;
    border-color: rgba(255, 255, 255, 0.15);
}

.auth-panel__tagline {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    text-align: center;
}

.auth-panel__footer {
    position: absolute;
    bottom: 1.75rem;
    left: 0; right: 0;
    text-align: center;
    z-index: 2;
}

.auth-panel__footer p {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.18);
}

/* ── AUTH FORM (Right) ──────────────────────────────── */
.auth-form {
    background: var(--surface-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 4rem;
    position: relative;
    transition: background 0.3s ease;
}

.auth-form .theme-toggle {
    position: absolute;
    top: 1.5rem; right: 1.5rem;
}

.auth-form__wrap {
    width: 100%;
    max-width: 380px;
    animation: fadeSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-form__header {
    margin-bottom: 2rem;
}

.auth-form__header h3 {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
}

.auth-form__header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ── FORM FIELDS (Floating Label) ───────────────────── */
.form-field {
    margin-bottom: 1.125rem;
}

.form-field__floating {
    position: relative;
}

.form-field__input {
    width: 100%;
    height: 54px;
    padding: 18px 14px 6px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--input-text);
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.form-field__input::placeholder { color: transparent; }

.form-field__input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-field__label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9375rem;
    color: var(--input-label);
    pointer-events: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-field__input:focus ~ .form-field__label,
.form-field__input:not(:placeholder-shown) ~ .form-field__label {
    top: 9px;
    transform: none;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--input-label-active);
    text-transform: uppercase;
}

/* Password modifier */
.form-field__floating--password .form-field__input {
    padding-right: 46px;
}

.form-field__toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9375rem;
    padding: 4px;
    display: flex;
    align-items: center;
    outline: none;
    transition: color 0.2s;
}

.form-field__toggle-btn:hover { color: var(--brand-primary); }

/* ── ERROR ALERT ────────────────────────────────────── */
.auth-alert {
    display: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--error-border);
    background: var(--error-bg);
    color: var(--error-text);
    line-height: 1.5;
    position: relative;
}

.auth-alert--visible { display: flex; align-items: flex-start; gap: 0.5rem; }

.auth-alert__icon { margin-top: 1px; flex-shrink: 0; }

.auth-alert__close {
    position: absolute;
    right: 6px; top: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--error-text);
    opacity: 0.5;
    font-size: 0.8125rem;
    padding: 6px 8px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    border-radius: 4px;
}

.auth-alert__close:hover { opacity: 1; }

/* ── SUBMIT BUTTON ──────────────────────────────────── */
.btn-submit {
    width: 100%;
    height: 48px;
    margin-top: 0.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.01em;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: var(--shadow-btn);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45); }
.btn-submit:hover::before { opacity: 1; }
.btn-submit:active { transform: translateY(0); }
.btn-submit--loading { pointer-events: none; opacity: 0.8; }

.btn-submit__spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-submit--loading .btn-submit__spinner { display: block; }
.btn-submit--loading .btn-submit__label   { opacity: 0.7; }

/* ── ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }

    .auth-panel {
        padding: 2rem 2rem 2.5rem;
        min-height: auto;
    }

    .auth-panel::after { display: none; }

    .auth-form {
        padding: 2.5rem 1.5rem;
        min-height: 65vh;
    }

    .auth-form__wrap { max-width: 100%; }
}

@media (max-width: 480px) {
    .auth-panel { padding: 1.5rem; }
    .auth-form  { padding: 2rem 1.25rem; }
    .auth-form__header h3 { font-size: 1.375rem; }
}
