/* ============================================================
   FatPipe Partner Portal — Auth Page Stylesheet
   Login & Registration page styles
   ============================================================ */

/* ---- Base ---- */
html { scrollbar-gutter: stable; }

/* ---- Auth Body ---- */
.auth-body {
    background: #F0F4FF;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

/* ---- Auth Container ---- */
.auth-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ---- Auth Left Panel ---- */
.auth-left {
    width: 420px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #0F172A 0%, #1E3A8A 60%, #2563EB 100%);
    display: flex;

    padding: 40px 36px;
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    overflow: hidden;
}
.auth-left::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}
.auth-left::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 240px; height: 240px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.auth-brand { position: relative; z-index: 1; }
.logo-container {
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}
.logo-icon {
    
    padding: 10px;
    width:150px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white;
    backdrop-filter: blur(10px);
}
.logo-text {
    font-size: 26px; font-weight: 800; color: white;
    letter-spacing: -0.5px;
}
.auth-tagline {
    font-size: 28px; font-weight: 800; color: white;
    line-height: 1.2; margin-bottom: 12px;
}
.auth-subtitle {
    font-size: 14px; color: rgba(255,255,255,0.75);
    line-height: 1.7; margin-bottom: 32px;
}
.auth-features { display: flex; flex-direction: column; gap: 12px; }
.feature-item {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: rgba(255,255,255,0.85);
}
.feature-item i { color: #34D399; font-size: 15px; flex-shrink: 0; }

/* ---- Auth Right Panel ---- */
.auth-right {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 24px;
    overflow-y: auto;
}

/* ---- Auth Card ---- */
.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 680px;
    overflow: hidden;
}

/* Only the 2FA code step is vertically centred (JS adds this class while
   that step is showing). Login/Register stay top-aligned. Auto margins
   keep it overflow-safe on short viewports. */
.auth-card.twofa-centered {
    margin: auto;
}

/* ---- Auth Tabs ---- */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid #E2E8F0;
}
.auth-tab {
    flex: 1;
    padding: 16px;
    background: none; border: none;
    font-size: 14px; font-weight: 600;
    color: #0F172A;
    cursor: pointer;
    transition: all 0.18s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.auth-tab:hover { color: #2563EB; }
.auth-tab.active { color: #2563EB; border-bottom-color: #2563EB; background: #FAFBFF; }

/* ---- Auth Forms ---- */
.auth-form {
    display: none;
    padding: 28px;
}
.auth-form.active { display: block; }
.auth-form h2 {
    font-size: 22px; font-weight: 800;
    color: #0F172A; margin-bottom: 4px;
}
.form-subtitle {
    font-size: 13px; color: #0F172A;
    margin-bottom: 22px;
}

/* ---- Form Elements (Auth-specific) ---- */
.auth-form .form-group {
    display: flex; flex-direction: column; gap: 5px;
    margin-bottom: 14px;
}
.auth-form .form-group label {
    font-size: 12px; font-weight: 600;
    color: #0F172A;
}
.auth-form .form-group small {
    font-size: 11px; color: #0F172A;
}
.auth-form .form-group input,
.auth-form .form-group select,
.auth-form .form-group textarea {
    padding: 10px 12px;
    border: 1px solid #94A3B8;
    border-radius: 7px;
    font-size: 13px; color: #0F172A;
    background: white;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
    width: 100%;
    font-family: 'Inter', sans-serif;
}
.auth-form .form-group input:focus,
.auth-form .form-group select:focus,
.auth-form .form-group textarea:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
/* Locked to a referred company's own answers (see js/auth.js setAndLock/
   setRadioAndLock/setCheckboxGridAndLock) — visibly greyed out, not just
   functionally disabled. */
.auth-form .form-group input:disabled,
.auth-form .form-group select:disabled {
    background: #EEF1F5; color: #64748B; border-color: #CBD5E1; cursor: not-allowed;
}
.auth-form .checkbox-label input[type="checkbox"]:disabled,
.auth-form .radio-label input[type="radio"]:disabled { cursor: not-allowed; opacity: 0.7; }
.auth-form .checkbox-label:has(input:disabled),
.auth-form .radio-label:has(input:disabled) { color: #64748B; cursor: not-allowed; }
.auth-form .form-group input::placeholder,
.auth-form .form-group textarea::placeholder { color: #64748B; }
.auth-form .form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.auth-form .form-group textarea { resize: vertical; min-height: 80px; }

.auth-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.auth-form .form-section-title {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: #0F172A;
    padding: 10px 0 6px;
    border-bottom: 1px solid #F1F5F9;
    margin-bottom: 14px;
    margin-top: 8px;
}
.auth-form .form-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    padding-top: 14px; flex-wrap: wrap;
}
.auth-form .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 6px;
}
.auth-form .checkbox-label {
    display: flex; align-items: flex-start; gap: 7px;
    font-size: 12px; color: #0F172A;
    cursor: pointer; line-height: 1.4;
}
.auth-form .checkbox-label input[type="checkbox"] {
    width: 14px; height: 14px;
    flex-shrink: 0; margin-top: 1px;
    accent-color: #2563EB;
}
.auth-form .radio-group { display: flex; gap: 16px; margin-top: 6px; }
.auth-form .radio-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: #0F172A; cursor: pointer;
}
.auth-form .radio-label input[type="radio"] { accent-color: #2563EB; }

/* Input wrapper with icon */
.auth-form .input-wrapper {
    position: relative !important;
    display: flex; align-items: center;
    width: 100%;
}
.auth-form .input-wrapper > i:first-child {
    position: absolute; left: 12px; z-index: 2;
    color: #000000; font-size: 14px;
    pointer-events: none;
}
.auth-form .input-wrapper input {
    flex: 1 1 auto; width: 100% !important;
    padding-left: 34px !important;
    padding-right: 42px !important;
}
.auth-form .toggle-password {
    position: absolute !important;
    right: 12px !important; left: auto !important;
    top: 50% !important; bottom: auto !important;
    transform: translateY(-50%) !important;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none;
    color: #000000; font-size: 15px; z-index: 2;
    cursor: pointer; padding: 2px; line-height: 1;
    transition: color 0.18s ease;
}
.auth-form .toggle-password:hover { color: #2563EB; }

/* Form options row */
.form-options {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.forgot-link {
    font-size: 12px; color: #2563EB; font-weight: 600;
}
.forgot-link:hover { text-decoration: underline; }

/* Terms label */
.terms-label {
    font-size: 12px; color: #0F172A;
    line-height: 1.5;
}
.terms-label a { color: #2563EB; font-weight: 600; }

/* ---- Auth Buttons ---- */
.btn-primary {
    display: inline-flex; align-items: center; gap: 7px;
    background: #2563EB; color: white;
    border: none;
    padding: 11px 20px;
    border-radius: 7px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}
.btn-primary:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
    text-decoration: none; color: white;
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 7px;
    background: white; color: #0F172A;
    border: 1px solid #E2E8F0;
    padding: 10px 18px;
    border-radius: 7px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}
.btn-secondary:hover {
    border-color: #2563EB; color: #2563EB;
    background: #EFF6FF;
    text-decoration: none;
}

.btn-full { width: 100%; justify-content: center; }

/* ---- Auth Divider ---- */
.auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 18px 0;
    color: #0F172A; font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
    content: ''; flex: 1;
    height: 1px; background: #E2E8F0;
}

/* ---- Modal (Auth) ---- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.modal-box {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 440px; width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    text-align: center;
    animation: modalIn 0.2s ease;
}
.modal-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}
.modal-icon.success { background: #ECFDF5; color: #059669; }
.modal-box h3 { font-size: 20px; font-weight: 700; color: #0F172A; margin-bottom: 10px; }
.modal-box p { font-size: 14px; color: #0F172A; line-height: 1.7; margin-bottom: 22px; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   RESPONSIVE — AUTH PAGE
   ============================================================ */

@media (max-width: 900px) {
    .auth-container { flex-direction: column; }
    .auth-left {
        width: 100%;
        padding: 28px 24px;
        min-height: auto;
        position: relative;
        top: auto;
        height: auto;
    }
    .auth-tagline { font-size: 22px; }
    .auth-features { display: none; }
    .auth-right {
        padding: 20px 16px;
        align-items: flex-start;
    }
    .auth-card { max-width: 100%; }
    .auth-form { padding: 20px; }
}

@media (max-width: 600px) {
    .auth-left { padding: 20px 16px; }
    .auth-tagline { font-size: 18px; }
    .auth-subtitle { font-size: 12px; }
    .auth-form .form-row { grid-template-columns: 1fr; }
    .auth-form .checkbox-grid { grid-template-columns: 1fr; }
    .auth-form .form-actions { flex-direction: column; }
    .auth-form .form-actions .btn-primary,
    .auth-form .form-actions .btn-secondary { width: 100%; justify-content: center; }
    .auth-form { padding: 16px; }
    .auth-form h2 { font-size: 18px; }
    .form-options { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
    .auth-left { padding: 16px; }
    .logo-text { font-size: 20px; }
    .auth-form { padding: 14px; }
}

/* Spinning loader icon for in-progress buttons (login / verify / reset).
   Uses a bootstrap-icon since the app doesn't load Font Awesome. */
.fp-spin {
    display: inline-block;
    animation: fp-spin 0.7s linear infinite;
}
@keyframes fp-spin {
    to { transform: rotate(360deg); }
}
