/* ===========================================
   SPLIT LAYOUT - AUTH THEME
   Roafly-style unified authentication page
   Light left panel + Dark right panel
   =========================================== */

/* =========================================
   1. CSS CUSTOM PROPERTIES
   ========================================= */

:root {
    /* Left panel (light) */
    --auth-light-bg: #ffffff;
    --auth-light-text: #1a1a2e;
    --auth-light-text-secondary: #6b7280;
    --auth-light-text-muted: #9ca3af;
    --auth-light-border: #e5e7eb;
    --auth-light-input-bg: #f9fafb;
    --auth-light-input-focus: rgba(16, 185, 129, 0.2);

    /* Right panel (dark) */
    --auth-dark-bg: #0f172a;
    --auth-dark-text: #ffffff;
    --auth-dark-text-secondary: rgba(255, 255, 255, 0.7);

    /* Accent colors */
    --auth-accent: #10b981;
    --auth-accent-hover: #059669;
    --auth-accent-light: rgba(16, 185, 129, 0.1);

    /* Status colors */
    --auth-error: #ef4444;
    --auth-error-bg: rgba(239, 68, 68, 0.1);
}

/* =========================================
   2. BASE STYLES
   ========================================= */

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

.auth-split-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-family: 'Urbanist', system-ui, -apple-system, sans-serif;
}

/* =========================================
   3. LEFT PANEL (FORM)
   ========================================= */

.auth-left-panel {
    background: var(--auth-light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease-out;
}

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

/* Logo */
.auth-split-logo {
    margin-bottom: 2rem;
}

.auth-split-logo a {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.auth-split-logo a:hover {
    opacity: 0.8;
}

.auth-split-logo img {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

/* Title */
.auth-split-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--auth-light-text);
    margin-bottom: 2rem;
    line-height: 1.2;
}

/* =========================================
   4. SOCIAL LOGIN BUTTONS
   ========================================= */

.auth-social-section {
    margin-bottom: 1.5rem;
}

.auth-social-btn-split {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: var(--auth-light-text);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.auth-social-btn-split:last-child {
    margin-bottom: 0;
}

.auth-social-btn-split:hover {
    background: #2d2d3a;
    transform: translateY(-1px);
}

.auth-social-btn-split svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Google button - white variant */
.auth-social-btn-split.google {
    background: #fff;
    border: 1px solid var(--auth-light-border);
    color: var(--auth-light-text);
}

.auth-social-btn-split.google:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* =========================================
   5. DIVIDER
   ========================================= */

.auth-split-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--auth-light-text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.auth-split-divider span {
    padding: 0 1rem;
}

/* =========================================
   6. FORM DESCRIPTION
   ========================================= */

.auth-form-description {
    font-size: 0.9375rem;
    color: var(--auth-light-text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* =========================================
   7. FORM FIELDS
   ========================================= */

.auth-split-form {
    width: 100%;
}

.auth-split-field {
    margin-bottom: 1rem;
    position: relative;
}

.auth-split-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-light-text);
    margin-bottom: 0.5rem;
}

.auth-split-input-wrapper {
    position: relative;
}

.auth-split-input-wrapper .field-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-light-text-muted);
    width: 20px;
    height: 20px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-split-input-wrapper:focus-within .field-icon {
    color: var(--auth-accent);
}

.auth-split-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: var(--auth-light-input-bg);
    border: 1px solid var(--auth-light-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--auth-light-text);
    transition: all 0.2s ease;
    outline: none;
}

.auth-split-input::placeholder {
    color: var(--auth-light-text-muted);
}

.auth-split-input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-light-input-focus);
    background: #fff;
}

.auth-split-input.is-invalid {
    border-color: var(--auth-error);
    box-shadow: 0 0 0 3px var(--auth-error-bg);
}

/* Password toggle */
.auth-password-toggle-split {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-light-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.auth-password-toggle-split:hover {
    color: var(--auth-accent);
}

/* Field error */
.auth-split-field-error {
    font-size: 0.75rem;
    color: var(--auth-error);
    margin-top: 0.375rem;
    display: block;
}

/* =========================================
   8. BUTTONS
   ========================================= */

.auth-split-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.auth-split-btn-primary {
    background: var(--auth-accent);
    color: #fff;
}

.auth-split-btn-primary:hover:not(:disabled) {
    background: var(--auth-accent-hover);
    transform: translateY(-1px);
}

.auth-split-btn-primary:active {
    transform: translateY(0);
}

.auth-split-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading state */
.auth-split-btn.loading {
    color: transparent;
    pointer-events: none;
}

.auth-split-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.8s linear infinite;
}

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

/* =========================================
   9. FORGOT PASSWORD LINK
   ========================================= */

.auth-split-forgot {
    display: block;
    text-align: right;
    margin-bottom: 1.25rem;
    margin-top: -0.5rem;
}

.auth-split-link {
    color: var(--auth-accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-split-link:hover {
    color: var(--auth-accent-hover);
    text-decoration: underline;
}

/* =========================================
   10. ALERTS
   ========================================= */

.auth-split-alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.auth-split-alert-error {
    background: var(--auth-error-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--auth-error);
}

.auth-split-alert ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* =========================================
   11. HIDDEN FIELDS CONTAINER
   ========================================= */

.auth-step-fields {
    display: none;
    animation: slideDown 0.3s ease-out;
}

.auth-step-fields.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   12. PASSWORD STRENGTH
   ========================================= */

.auth-split-strength {
    display: flex;
    gap: 4px;
    margin-top: 0.5rem;
}

.auth-split-strength-bar {
    flex: 1;
    height: 3px;
    background: var(--auth-light-border);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.auth-split-strength-bar.active.weak {
    background: var(--auth-error);
}

.auth-split-strength-bar.active.fair {
    background: #f59e0b;
}

.auth-split-strength-bar.active.good {
    background: #10b981;
}

.auth-split-strength-bar.active.strong {
    background: #059669;
}

/* =========================================
   13. RIGHT PANEL (TESTIMONIAL)
   ========================================= */

.auth-right-panel {
    background: var(--auth-dark-bg);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
    overflow: hidden;
}

/* Background with abstract shapes */
.auth-right-bg {
    position: absolute;
    inset: 0;
}

/* Abstract shapes */
.auth-abstract-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
}

.auth-abstract-shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    top: -100px;
    right: -100px;
    animation: floatShape1 20s ease-in-out infinite;
}

.auth-abstract-shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #10b981, #059669);
    bottom: 20%;
    left: 10%;
    animation: floatShape2 25s ease-in-out infinite;
}

.auth-abstract-shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    bottom: -50px;
    right: 20%;
    animation: floatShape3 18s ease-in-out infinite;
}

@keyframes floatShape1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-30px, 30px) scale(1.1); }
    66% { transform: translate(20px, -20px) scale(0.95); }
}

@keyframes floatShape2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -40px) scale(1.15); }
}

@keyframes floatShape3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, 20px) scale(1.05); }
    66% { transform: translate(-20px, -30px) scale(0.9); }
}

/* Overlay gradient */
.auth-right-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(15, 23, 42, 0.6) 50%,
        rgba(15, 23, 42, 0.3) 100%
    );
}

/* Testimonial content */
.auth-testimonial {
    position: relative;
    z-index: 10;
    max-width: 500px;
}

.auth-testimonial-quote-icon {
    width: 48px;
    height: 48px;
    color: var(--auth-accent);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.auth-testimonial-text {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--auth-dark-text);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.auth-testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.auth-testimonial-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-accent), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.auth-testimonial-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--auth-dark-text);
}

/* =========================================
   14. RESPONSIVE DESIGN
   ========================================= */

@media (max-width: 1024px) {
    .auth-split-page {
        grid-template-columns: 1fr;
    }

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

    .auth-left-panel {
        min-height: 100vh;
    }
}

@media (max-width: 480px) {
    .auth-left-panel {
        padding: 1.5rem;
    }

    .auth-form-container {
        max-width: 100%;
    }

    .auth-split-title {
        font-size: 1.75rem;
    }

    .auth-split-input {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 0.9375rem;
    }

    .auth-split-btn {
        padding: 0.75rem 1.25rem;
    }
}

/* =========================================
   15. REDUCED MOTION
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    .auth-form-container,
    .auth-step-fields,
    .auth-split-strength-bar {
        animation: none;
    }

    .auth-split-btn.loading::after {
        animation: none;
    }

    .auth-split-btn:hover,
    .auth-social-btn-split:hover {
        transform: none;
    }
}

/* =========================================
   16. INVITATION CODE (OPTIONAL)
   ========================================= */

.auth-split-field.invitation-field {
    margin-top: 0.5rem;
}

.auth-split-field.invitation-field .auth-split-input {
    background: var(--auth-accent-light);
    border-color: var(--auth-accent);
}

.auth-split-field.invitation-field .auth-split-input:read-only {
    cursor: not-allowed;
    opacity: 0.8;
}

/* =========================================
   17. OTP INPUT STYLES
   ========================================= */

.auth-split-otp-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 2rem 0;
}

.auth-split-otp-input {
    width: 60px;
    height: 72px;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    font-family: inherit;
    background: var(--auth-light-input-bg);
    border: 2px solid var(--auth-light-border);
    border-radius: 12px;
    color: var(--auth-light-text);
    transition: all 0.3s ease;
    caret-color: var(--auth-accent);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.auth-split-otp-input::-webkit-outer-spin-button,
.auth-split-otp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.auth-split-otp-input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-light-input-focus);
    transform: scale(1.05);
}

.auth-split-otp-input.filled {
    background: var(--auth-accent-light);
    border-color: var(--auth-accent);
}

.auth-split-otp-input.is-invalid {
    border-color: var(--auth-error);
    box-shadow: 0 0 0 3px var(--auth-error-bg);
}

/* Resend section */
.auth-split-resend {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-split-resend-timer {
    color: var(--auth-light-text-muted);
    font-size: 0.875rem;
}

.auth-split-resend-btn {
    background: none;
    border: none;
    color: var(--auth-accent);
    font-weight: 600;
    font-size: 0.9375rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.auth-split-resend-btn:hover:not(:disabled) {
    color: var(--auth-accent-hover);
}

.auth-split-resend-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================================
   18. SUBTITLE & DESCRIPTION
   ========================================= */

.auth-split-subtitle {
    font-size: 0.9375rem;
    color: var(--auth-light-text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.auth-split-subtitle strong {
    color: var(--auth-light-text);
    font-weight: 600;
}

/* =========================================
   19. FOOTER LINK
   ========================================= */

.auth-split-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-split-footer .auth-split-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   20. RECAPTCHA
   ========================================= */

.auth-split-recaptcha {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-split-recaptcha > div {
    transform: scale(0.95);
    transform-origin: center;
}

/* =========================================
   21. RESPONSIVE OTP
   ========================================= */

@media (max-width: 480px) {
    .auth-split-otp-input {
        width: 50px;
        height: 60px;
        font-size: 1.5rem;
        border-radius: 10px;
    }

    .auth-split-otp-container {
        gap: 0.5rem;
    }
}

@media (max-width: 360px) {
    .auth-split-otp-input {
        width: 45px;
        height: 55px;
        font-size: 1.25rem;
        border-radius: 8px;
    }
}
