/* =========================================================
   Auth Pages — Login & Register
   ========================================================= */

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

body.auth-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    background: #f3f4f6;
}

/* ── Left Panel ── */
.auth-left {
    width: 44%;
    background: linear-gradient(145deg, #15803d 0%, #16a34a 45%, #22c55e 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 52px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.auth-left::before {
    content: '';
    position: absolute;
    top: -140px; right: -140px;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(255,255,255,0.13) 0%, transparent 68%);
    pointer-events: none;
}
.auth-left::after {
    content: '';
    position: absolute;
    bottom: -100px; left: -80px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(0,0,0,0.07) 0%, transparent 68%);
    pointer-events: none;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}
.auth-brand-logo {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.22);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.auth-brand-logo img {
    width: 100%; height: 100%;
    object-fit: contain;
}
.auth-brand-logo-letter {
    font-size: 22px; font-weight: 900; color: white;
}
.auth-brand-name {
    font-size: 22px; font-weight: 900; color: white; letter-spacing: -0.3px;
}

.auth-left-heading {
    font-size: 34px; font-weight: 900; color: white;
    line-height: 1.2; margin-bottom: 14px;
    position: relative; z-index: 1;
}
.auth-left-sub {
    font-size: 15px; color: rgba(255,255,255,0.82);
    line-height: 1.7; margin-bottom: 38px;
    position: relative; z-index: 1;
}

/* Features list */
.auth-features {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; gap: 16px;
}
.auth-feature {
    display: flex; align-items: center; gap: 14px;
}
.auth-feature-icon {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 19px; color: white;
}
.auth-feature-title {
    font-size: 13.5px; font-weight: 700; color: white;
}
.auth-feature-desc {
    font-size: 12.5px; color: rgba(255,255,255,0.72); margin-top: 1px;
}

/* Stats row */
.auth-stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px; margin-top: 38px; padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.22);
    position: relative; z-index: 1;
}
.auth-stat-val {
    font-size: 24px; font-weight: 900; color: white;
}
.auth-stat-label {
    font-size: 12px; color: rgba(255,255,255,0.68); margin-top: 2px;
}

/* Perks (register page) */
.auth-perks {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; gap: 12px;
}
.auth-perk {
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 13px 15px;
    display: flex; align-items: center; gap: 12px;
}
.auth-perk-icon {
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.18);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 17px; color: white;
}
.auth-perk-name {
    font-size: 13px; font-weight: 700; color: white;
}
.auth-perk-desc {
    font-size: 11.5px; color: rgba(255,255,255,0.68); margin-top: 1px;
}

/* ── Right Panel ── */
.auth-right {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 24px;
    overflow-y: auto;
}
.auth-card {
    width: 100%; max-width: 430px;
}
.auth-card-title {
    font-size: 27px; font-weight: 900; color: #111827;
    letter-spacing: -0.4px; margin-bottom: 5px;
}
.auth-card-subtitle {
    font-size: 14px; color: #6b7280; margin-bottom: 26px;
}

/* Alerts */
.auth-alert {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 12px 14px; border-radius: 10px;
    margin-bottom: 18px; font-size: 13.5px; line-height: 1.5;
}
.auth-alert-error {
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.2);
    color: #991b1b;
}
.auth-alert-success {
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.25);
    color: #166534;
}

/* Social buttons */
.auth-social {
    display: flex; gap: 10px; margin-bottom: 22px;
}
.auth-social-btn {
    flex: 1; padding: 11px 14px;
    border: 1.5px solid #e5e7eb; border-radius: 12px;
    background: white;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 13.5px; font-weight: 600; color: #374151;
    text-decoration: none; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}
.auth-social-btn:hover {
    border-color: #22c55e; background: #f0fdf4;
}

/* Divider */
.auth-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 4px 0 20px;
}
.auth-divider-line { flex: 1; height: 1px; background: #e5e7eb; }
.auth-divider-text { font-size: 12px; color: #9ca3af; font-weight: 500; white-space: nowrap; }

/* Form elements */
.auth-form-group { margin-bottom: 16px; }
.auth-label {
    display: block; font-size: 13px; font-weight: 600;
    color: #374151; margin-bottom: 6px;
}
.auth-label-req { color: #ef4444; margin-left: 2px; }

.auth-input-wrap { position: relative; }
.auth-input-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: #9ca3af; font-size: 13.5px; pointer-events: none;
}
.auth-input {
    width: 100%; padding: 11px 14px 11px 40px;
    border: 1.5px solid #e5e7eb; border-radius: 11px;
    font-size: 14px; color: #111827; background: white;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus {
    outline: none; border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
}
.auth-input.is-invalid { border-color: #ef4444; }
.auth-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

.auth-field-error { font-size: 12px; color: #ef4444; margin-top: 4px; }

/* Password toggle */
.auth-pw-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: #9ca3af; font-size: 13.5px; padding: 2px 4px;
    display: flex; align-items: center;
}
.auth-pw-toggle:hover { color: #6b7280; }
.auth-input-pw { padding-right: 40px; }

/* Remember / forgot row */
.auth-options {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.auth-remember {
    display: flex; align-items: center; gap: 7px;
    font-size: 13.5px; color: #374151; cursor: pointer; user-select: none;
}
.auth-remember input { accent-color: #22c55e; width: 15px; height: 15px; cursor: pointer; }
.auth-forgot { font-size: 13.5px; color: #16a34a; font-weight: 600; text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; }

/* Submit button */
.auth-btn {
    width: 100%; padding: 13px 20px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white; border: none; border-radius: 12px;
    font-size: 15px; font-weight: 700; font-family: inherit;
    cursor: pointer; letter-spacing: 0.1px;
    transition: opacity 0.2s, transform 0.1s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn:hover { opacity: 0.92; }
.auth-btn:active { transform: scale(0.99); }

/* Role selector (register) */
.auth-role-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 20px;
}
.auth-role-opt {
    border: 2px solid #e5e7eb; border-radius: 12px;
    padding: 14px 12px; cursor: pointer; text-align: center;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}
.auth-role-opt:hover { border-color: #86efac; background: rgba(34,197,94,0.03); }
.auth-role-opt.selected { border-color: #22c55e; background: rgba(34,197,94,0.06); }
.auth-role-icon { font-size: 22px; margin-bottom: 6px; color: #374151; }
.auth-role-opt.selected .auth-role-icon { color: #16a34a; }
.auth-role-name { font-size: 13.5px; font-weight: 700; color: #111827; }
.auth-role-desc { font-size: 11.5px; color: #6b7280; margin-top: 2px; }

/* Terms checkbox */
.auth-terms {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 13px; color: #374151; cursor: pointer; margin-bottom: 18px;
}
.auth-terms input { accent-color: #22c55e; width: 15px; height: 15px; margin-top: 1px; flex-shrink: 0; cursor: pointer; }
.auth-terms a { color: #16a34a; font-weight: 600; text-decoration: none; }
.auth-terms a:hover { text-decoration: underline; }

/* 2-col grid */
.auth-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Footer link row */
.auth-footer {
    text-align: center; font-size: 13.5px; color: #6b7280; margin-top: 20px;
}
.auth-footer a { color: #16a34a; font-weight: 700; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
    .auth-left { width: 38%; padding: 40px 32px; }
    .auth-left-heading { font-size: 26px; }
}
@media (max-width: 700px) {
    .auth-left { display: none; }
    .auth-right { padding: 32px 16px; }
    .auth-grid-2 { grid-template-columns: 1fr; }
    .auth-role-grid { grid-template-columns: 1fr 1fr; }
}

/* Left panel background image mode */
.auth-left-has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.auth-left-overlay {
    display: none;
}
.auth-left-has-image .auth-left-overlay {
    display: block;
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(21,128,61,0.82) 0%, rgba(22,163,74,0.70) 100%);
    z-index: 0;
}
.auth-left-has-image .auth-brand,
.auth-left-has-image .auth-left-heading,
.auth-left-has-image .auth-left-sub,
.auth-left-has-image .auth-features,
.auth-left-has-image .auth-perks,
.auth-left-has-image .auth-stats {
    position: relative;
    z-index: 1;
}

/* Two-factor verification */
.auth-2fa-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border-radius: 50%;
    margin-bottom: 4px;
}
.auth-2fa-icon i {
    font-size: 26px;
    color: #fff;
}
.auth-2fa-input {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 10px;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    padding-left: 44px;
}
.auth-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.auth-2fa-resend {
    text-align: center;
    font-size: 14px;
    color: #6B7280;
    margin-top: 16px;
}
.auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: #16a34a;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}
.auth-link-btn:hover { text-decoration: underline; }
.auth-back-link {
    font-size: 14px;
    color: #6B7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.auth-back-link:hover { color: #16a34a; }
