/* ============================================================
   auth-base.css
   Core variables, reset, split layout, brand panel,
   form elements, buttons, divider, footer, badge
   ============================================================ */

/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #1D4E63;
    --primary-dark: #163d50;
    --primary-light: #e6f0f4;
    --primary-mid: #1e6080;
    --secondary-color: #D93535;
    --secondary-hover: #be2e2e;
    --text-dark: #1a1a1a;
    --text-main: #333333;
    --text-muted: #666666;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --light-gray: #f3f4f6;
    --success-green: #10b981;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

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

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100%;
    overflow-x: hidden;
}

/* ===== SPLIT LAYOUT ===== */
.auth-container {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100vh;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* ===== LEFT PANEL – WAVE DESIGN ===== */
.auth-brand-panel {
    width: 55%;
    flex-shrink: 0;
    background: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 60px 40px;
}

/* Wave layers on the right edge */
.wave-layer {
    position: absolute;
    top: 0;
    bottom: 0;
    right: -1px;
    width: 120px;
}

.wave-1 {
    background: var(--card-bg);
    clip-path: path('M120,0 L120,10000 L0,10000 L0,1000 C40,850 80,750 60,600 C40,450 90,350 70,200 C55,100 80,50 120,0 Z');
    z-index: 3;
}

.wave-2 {
    right: 20px;
    width: 130px;
    background: rgba(255, 255, 255, 0.08);
    clip-path: path('M130,0 L130,10000 L0,10000 L0,1000 C50,870 90,760 65,620 C40,470 100,370 75,220 C55,110 85,40 130,0 Z');
    z-index: 2;
}

.wave-3 {
    right: 40px;
    width: 140px;
    background: rgba(255, 255, 255, 0.04);
    clip-path: path('M140,0 L140,10000 L0,10000 L0,1000 C60,880 100,780 70,630 C40,480 110,380 80,230 C55,110 90,40 140,0 Z');
    z-index: 1;
}

/* Brand content */
.brand-content {
    position: relative;
    z-index: 4;
    text-align: center;
    max-width: 320px;
}

.brand-welcome {
    font-size: 1.25rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 28px;
    letter-spacing: 0.02em;
}

.brand-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 14px 28px;
    margin-bottom: 20px;
}

.brand-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    display: block;
    filter:
        drop-shadow(1px 0 0 rgba(255,255,255,0.75))
        drop-shadow(-1px 0 0 rgba(255,255,255,0.75))
        drop-shadow(0 1px 0 rgba(255,255,255,0.75))
        drop-shadow(0 -1px 0 rgba(255,255,255,0.75))
        drop-shadow(1px 1px 0 rgba(255,255,255,0.55))
        drop-shadow(-1px -1px 0 rgba(255,255,255,0.55))
        drop-shadow(1px -1px 0 rgba(255,255,255,0.55))
        drop-shadow(-1px 1px 0 rgba(255,255,255,0.55));
}

.brand-name {
    display: none;
}

.brand-description {
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.6);
    max-width: 280px;
    margin: 0 auto;
}

/* Brand footer */
.brand-footer {
    position: absolute;
    bottom: 32px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-footer a {
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    letter-spacing: 0.08em;
    transition: var(--transition);
}

.brand-footer a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.footer-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

/* ===== RIGHT PANEL – FORM ===== */
.auth-form-panel {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 52px;
    background: var(--card-bg);
    overflow: hidden;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-form-header {
    margin-bottom: 18px;
}

.auth-form-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* ===== ERROR MESSAGE ===== */
.auth-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.auth-error svg {
    flex-shrink: 0;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.form-input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-dark);
    background: var(--card-bg);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 65, 91, 0.1);
}

.form-input::placeholder {
    color: #b0b7be;
}

/* intl-tel-input overrides */
.phone-input-group { width: 100%; }
.iti { width: 100%; display: block !important; }
.iti__flag-container { padding: 2px; }
.iti__selected-flag {
    background: var(--light-gray) !important;
    border-right: 1.5px solid var(--border-color) !important;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
    height: 40px !important;
}
.phone-number-input {
    border-radius: var(--radius-sm) !important;
    width: 100% !important;
}

/* ===== FORM OPTIONS ROW ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.terms-link,
.terms-link:visited {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.terms-link:hover { text-decoration: underline; }

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.custom-checkbox input[type="checkbox"] { display: none; }

.checkmark {
    width: 16px;
    height: 16px;
    border: 1.5px solid #9ca3af;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}
.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}
.custom-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.forgot-link {
    font-size: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}
.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== SIGN IN BUTTON ===== */
.btn-signin {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-signin:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 65, 91, 0.3);
}
.btn-signin:active:not(:disabled) { transform: translateY(0); }
.btn-signin:disabled { opacity: 0.7; cursor: not-allowed; }

.spinner { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== DIVIDER ===== */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 14px 0;
    gap: 12px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}
.auth-divider span {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===== SOCIAL BUTTONS ===== */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn-social {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
}
.btn-social:hover:not(:disabled) {
    background: var(--light-gray);
    border-color: #ccc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.btn-social:active:not(:disabled) { transform: translateY(0); }
.btn-social:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-social svg { flex-shrink: 0; }
.btn-social span { font-weight: 600; }

/* ===== AUTH FOOTER ===== */
.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.register-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}
.register-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== POWERED-BY BADGE ===== */
.powered-badge {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #aaa;
    letter-spacing: 0.04em;
    pointer-events: none;
}
.powered-badge strong {
    color: #D93535;
    font-weight: 700;
    font-size: 0.75rem;
}

/* Mobile-only footer links: hidden by default */
.mobile-footer-links { display: none !important; }
