/* ============================================================
   Auth Pages Styles (Login, Register, Reset Password, etc.)
   ============================================================ */

:root {
    --color-primary: #018A00;
    --color-primary-dark: #017500;
    --color-dark: #0f172a;
    --color-muted: #64748b;
    --color-surface: #f8fafc;
    --color-border: #e2e8f0;
    --gradient-hero: linear-gradient(135deg, #56b559 0%, #208375 100%);
    --gradient-mesh: linear-gradient(135deg, #56b559 0%, #208375 100%);
    --radius: 12px;
    --radius-lg: 20px;
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: var(--color-dark);
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
}

/* ── Left panel: decorative ─────────────────────── */
.login-hero {
    flex: 1;
    background: var(--gradient-mesh);
    position: relative;
    overflow: hidden;
    display: none;
}

@media (min-width: 1024px) {
    .login-hero { display: flex; align-items: center; justify-content: center; }
}

.login-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle 600px at 20% 30%, rgba(255,255,255,0.12), transparent),
        radial-gradient(circle 400px at 80% 70%, rgba(32,131,117,0.2), transparent);
}

.hero-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    background: #fff;
}

.hero-shapes .shape-1 { width: 400px; height: 400px; top: -80px; left: -100px; }
.hero-shapes .shape-2 { width: 250px; height: 250px; bottom: 10%; right: -60px; }
.hero-shapes .shape-3 { width: 160px; height: 160px; top: 50%; left: 30%; }
.hero-shapes .shape-4 {
    width: 100px; height: 100px;
    bottom: 25%; left: 15%;
    border-radius: var(--radius-lg);
    transform: rotate(35deg);
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    padding: 3rem;
    max-width: 480px;
}

.hero-content .hero-icon {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-content .hero-icon svg {
    width: 28px;
    height: 28px;
    stroke: #fff;
}

.hero-content h2 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: 0.85;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.hero-stats .stat {
    text-align: left;
}

.hero-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-stats .stat-label {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

/* ── Right panel: form ──────────────────────────── */
.login-panel {
    flex: 1;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: #fff;
    position: relative;
}

@media (min-width: 1024px) {
    .login-panel {
        max-width: 560px;
        min-width: 480px;
    }
}

@media (max-width: 1023px) {
    .login-panel {
        max-width: 100%;
        flex: 1;
        background: var(--color-surface);
    }
}

.login-form-wrapper {
    width: 100%;
    max-width: 380px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    margin-bottom: 2.75rem;
}

.brand-logo .logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo .logo-icon img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.brand-logo span {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-dark);
    letter-spacing: -0.02em;
}

.form-heading h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--color-dark);
    letter-spacing: -0.02em;
    margin-bottom: 0.45rem;
}

.form-heading p {
    color: var(--color-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* ── Alert ──────────────────────────────────────── */
.login-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.login-alert svg {
    width: 18px;
    height: 18px;
    stroke: #dc2626;
    flex-shrink: 0;
    margin-top: 1px;
}

.login-alert span {
    color: #991b1b;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.45;
}

.login-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.login-alert-success svg {
    stroke: #16a34a;
}

.login-alert-success span {
    color: #166534;
}

/* ── Form fields ────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-dark);
    margin-bottom: 0.45rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--color-muted);
    pointer-events: none;
    transition: stroke 0.2s;
}

.input-wrapper input {
    width: 100%;
    padding: 0.72rem 0.9rem 0.72rem 2.65rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--color-dark);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

.input-wrapper input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.input-wrapper input:focus ~ .input-icon {
    stroke: var(--color-primary);
}

.input-wrapper input.is-invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
    stroke: var(--color-muted);
    transition: stroke 0.2s;
}

.toggle-password:hover svg {
    stroke: var(--color-primary);
}

.field-error {
    font-size: 0.82rem;
    color: #dc2626;
    margin-top: 0.35rem;
    font-weight: 500;
}

/* ── Remember + submit row ──────────────────────── */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.remember-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.remember-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--color-border);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
}

.remember-check input[type="checkbox"]:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.remember-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-check span {
    font-size: 0.875rem;
    color: var(--color-muted);
    font-weight: 500;
    user-select: none;
}

.forgot-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: var(--gradient-hero);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 4px 14px rgba(86, 181, 89, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

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

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(86, 181, 89, 0.45);
}

.btn-login:hover::before { opacity: 1; }

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

.btn-login svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    transition: transform 0.2s;
}

.btn-login:hover svg {
    transform: translateX(3px);
}

.btn-login:disabled {
    cursor: not-allowed;
    opacity: 0.75;
    transform: none;
    box-shadow: 0 4px 14px rgba(86, 181, 89, 0.2);
}

.btn-login:disabled:hover {
    transform: none;
    box-shadow: 0 4px 14px rgba(86, 181, 89, 0.2);
}

.btn-login:disabled:hover::before { opacity: 0; }

.btn-login .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-login.is-loading .btn-text { display: none; }
.btn-login.is-loading .btn-arrow { display: none; }
.btn-login.is-loading .spinner { display: block; }

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

/* ── Divider ────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.75rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.divider span {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.back-home {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--color-border);
    transition: all 0.2s;
    width: 100%;
}

.back-home svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    transition: transform 0.2s;
}

.back-home:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.04);
}

.back-home:hover svg {
    transform: translateX(-3px);
}

/* ── Footer ─────────────────────────────────────── */
.login-footer {
    margin-top: 3rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* ── Password Requirements ─────────────────────── */
.password-requirements {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
}
.password-requirements p {
    font-size: 0.78rem;
    color: var(--color-muted);
    margin: 0;
    font-weight: 500;
}

/* ── Animations ─────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-form-wrapper {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

.hero-content {
    animation: fadeInUp 0.7s ease-out;
}

.shape-1 { animation: float 7s ease-in-out infinite; }
.shape-2 { animation: float 9s ease-in-out infinite 1s; }
.shape-3 { animation: float 6s ease-in-out infinite 2s; }
.shape-4 { animation: float 8s ease-in-out infinite 0.5s; }
