/* =========================================================
   LOGIN / REGISTER PAGE
========================================================= */

.auth-page {
    background: var(--surface-soft, #f8f8f6);
}

/* ---------- Auth Section ---------- */
.auth-section {
    padding: 48px 0 80px;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 980px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-xl, 20px);
    overflow: hidden;
    box-shadow: var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, 0.12));
    border: 1px solid var(--border, #e8e8e8);
}

/* ---------- Side Panel (desktop) ---------- */
.auth-side-panel {
    background: linear-gradient(145deg, #002866 0%, #00409e 50%, #0061af 100%);
    color: #fff;
    padding: 48px 40px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.auth-side-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(0, 143, 198, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 127, 190, 0.25) 0%, transparent 45%);
    pointer-events: none;
}

.auth-side-content {
    position: relative;
    z-index: 1;
}

.auth-side-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(0, 127, 190, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--accent, #007fbe);
    margin-bottom: 28px;
}

.auth-side-content h2 {
    font-family: var(--font-heading, "Playfair Display", serif);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 14px;
    color: #fff;
}

.auth-side-content > p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    margin: 0 0 32px;
    line-height: 1.6;
}

.auth-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.auth-benefits i {
    color: var(--accent, #007fbe);
    font-size: 16px;
    flex-shrink: 0;
}

/* ---------- Auth Card ---------- */
.auth-card {
    padding: 40px 44px 36px;
    display: flex;
    flex-direction: column;
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: #f3f3f1;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 28px;
}

.auth-tab {
    flex: 1;
    padding: 11px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-tab:hover {
    color: #333;
}

.auth-tab.active {
    background: #fff;
    color: #111;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Panel */
.auth-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.auth-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-panel-header {
    margin-bottom: 26px;
}

.auth-panel-header h1 {
    font-family: var(--font-heading, "Playfair Display", serif);
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #111;
}

.auth-panel-header p {
    margin: 0;
    font-size: 14px;
    color: #777;
}

/* Form */
.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
}

.label-row label {
    margin-bottom: 0;
}

.forgot-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent, #007fbe);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--accent-dark, #0061af);
}

.input-with-icon {
    position: relative;
}

.input-with-icon > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 15px;
    pointer-events: none;
    z-index: 1;
}

.auth-input {
    height: 48px;
    padding: 0 44px 0 42px !important;
    border: 1.5px solid #e5e5e5 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    background: #fafafa !important;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s !important;
}

.auth-input:focus {
    border-color: var(--accent, #007fbe) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 127, 190, 0.15) !important;
    outline: none !important;
}

.auth-input.is-invalid {
    border-color: var(--danger, #c63d3d) !important;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.toggle-password:hover {
    color: #555;
}

.field-error {
    display: block;
    font-size: 12px;
    color: var(--danger, #c63d3d);
    margin-top: 5px;
    min-height: 0;
}

/* Checkbox */
.form-check-row {
    margin-bottom: 22px;
}

.custom-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}

.custom-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-check .checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 1px;
    position: relative;
    transition: all 0.2s;
}

.custom-check input:checked + .checkmark {
    background: var(--accent, #007fbe);
    border-color: var(--accent, #007fbe);
}

.custom-check input:checked + .checkmark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.inline-link {
    color: var(--accent, #007fbe);
    text-decoration: none;
    font-weight: 500;
}

.inline-link:hover {
    text-decoration: underline;
}

/* Primary Button */
.auth-primary-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: var(--primary, #00409e);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-primary-btn:hover {
    background: #00307a;
}

.auth-primary-btn:active {
    transform: scale(0.985);
}

.auth-primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

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

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0 18px;
    color: #aaa;
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e8e8e8;
}

/* Social buttons */
.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.social-btn {
    height: 44px;
    border: 1.5px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color 0.2s, background 0.2s;
}

.social-btn:hover {
    border-color: #ccc;
    background: #fafafa;
}

.social-btn i {
    font-size: 16px;
}

.social-btn .bi-google {
    color: #ea4335;
}

.social-btn .bi-facebook {
    color: #1877f2;
}

/* Switch text */
.auth-switch {
    text-align: center;
    font-size: 13px;
    color: #777;
    margin: 0;
}

.switch-link {
    background: none;
    border: none;
    color: var(--accent, #007fbe);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.switch-link:hover {
    text-decoration: underline;
}

/* Toast */
.auth-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #00409e;
    color: #fff;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    max-width: 90vw;
    text-align: center;
}

.auth-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.auth-toast.success {
    background: #1a7a3a;
}

.auth-toast.error {
    background: #b33a3a;
}

/* Active account icon in header */
.header-action.active-auth {
    color: var(--accent, #007fbe);
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

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

    .auth-card {
        padding: 36px 28px 32px;
    }
}

@media (max-width: 575px) {
    .auth-section {
        padding: 28px 0 50px;
    }

    .auth-card {
        padding: 28px 20px 26px;
        border-radius: 16px;
    }

    .auth-panel-header h1 {
        font-size: 22px;
    }

    .social-buttons {
        grid-template-columns: 1fr;
    }

    .auth-tabs {
        margin-bottom: 22px;
    }
}


.optional-label {
    font-weight: 400;
    color: #999;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
}


/* =========================================================
   FORGOT PASSWORD MODAL
========================================================= */

.forgot-modal {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.forgot-modal .modal-header {
    padding: 16px 16px 0;
}

.forgot-modal .modal-body {
    padding-top: 0;
}

.forgot-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 16px;
    background: rgba(0, 127, 190, 0.12);
    color: var(--accent, #007fbe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.forgot-icon.success {
    background: rgba(26, 138, 76, 0.12);
    color: #1a8a4c;
}

.forgot-step h3 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin: 0 0 8px;
}

.forgot-desc {
    text-align: center;
    font-size: 14px;
    color: #777;
    margin: 0 0 24px;
    line-height: 1.55;
}

.forgot-desc strong {
    color: #333;
}

.forgot-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.forgot-back-btn:hover {
    color: var(--accent, #007fbe);
}
