/* public/assets/css/login.css */

/* ==========================================================
   Design tokens — scoped to .auth-page only, so nothing bleeds
   into variables.css (shared with the admin/form/success pages)
   ========================================================== */
.auth-page {
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --border-strong: #CBD5E1;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;

    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-soft: rgba(37, 99, 235, 0.1);

    --success: #22C55E;
    --danger: #EF4444;

    --radius-sm: 8px;
    --radius-btn: 12px;
    --radius-lg: 16px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms var(--ease);
    --transition: 200ms var(--ease);

    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
    font-family: 'Inter', var(--font-main, sans-serif);
    overflow: hidden;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-page :is(button, input, a):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Shared "hidden" utility — required exact name/behaviour */
.hidden { display: none !important; }

/* ==========================================================
   Background — subtle abstract gradient wash, no hard shapes
   ========================================================== */
.auth-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
}

.auth-blob-1 {
    width: 480px;
    height: 480px;
    top: -140px;
    left: -120px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0) 70%);
}

.auth-blob-2 {
    width: 520px;
    height: 520px;
    bottom: -180px;
    right: -140px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.3), rgba(96, 165, 250, 0) 70%);
}

/* ==========================================================
   Auth card
   ========================================================== */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    opacity: 0;
    transform: translateY(14px);
    animation: cardIn 350ms var(--ease) 60ms forwards;
}

@keyframes cardIn {
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo {
    height: 40px;
    width: auto;
    margin: 0 auto 20px;
    display: block;
}

.auth-header h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.auth-header p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-form {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ==========================================================
   Inputs — 50px height, leading icon
   ========================================================== */
.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-icon-wrap input {
    width: 100%;
    height: 50px;
    padding: 0 16px 0 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-icon-wrap input::placeholder {
    color: var(--text-muted);
}

.input-icon-wrap input:hover {
    border-color: var(--border-strong);
}

.input-icon-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.password-wrapper input {
    padding-right: 46px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}

.toggle-password:hover {
    background: var(--bg);
    color: var(--text-secondary);
}

.toggle-password svg {
    width: 17px;
    height: 17px;
}

/* ==========================================================
   Remember me — custom checkbox
   ========================================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.remember-me {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    position: absolute;
    width: 18px;
    height: 18px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.checkbox-box {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
    background: var(--surface);
    color: #fff;
    transition: background var(--transition), border-color var(--transition);
}

.checkbox-box svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.remember-me input:checked ~ .checkbox-box {
    background: var(--primary);
    border-color: var(--primary);
}

.remember-me input:checked ~ .checkbox-box svg {
    opacity: 1;
    transform: scale(1);
}

.remember-me input:focus-visible ~ .checkbox-box {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==========================================================
   Submit button — premium gradient
   ========================================================== */
.btn-primary {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: filter var(--transition), transform var(--transition-fast), box-shadow var(--transition);
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-text {
    display: inline-block;
    transition: opacity var(--transition);
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    position: absolute;
    top: calc(50% - 10px);
    left: calc(50% - 10px);
}

.spinner.hidden {
    display: none;
}

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

/* ==========================================================
   Support link
   ========================================================== */
.auth-support {
    margin: 24px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-support a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-support a:hover {
    text-decoration: underline;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 480px) {
    .auth-page { padding: 16px; }
    .auth-card { padding: 28px 22px; box-shadow: var(--shadow-sm); }
    .auth-blob { filter: blur(60px); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
