/* login.css — FasTrip Login Page Styles */

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

:root {
    --bg-dark: #0a0a12;
    --bg-card-dark: rgba(0,0,0,0.9);
    --text-dark: #f0f0f0;
    --text-muted-dark: #888;
    --border-dark: #333;
    --input-dark: #1a1a24;
    
    --bg-light: #F5F0E6;
    --bg-card-light: #F5F0E6;
    --text-light: #2d2d2d;
    --text-muted-light: #666;
    --border-light: #ddd;
    --input-light: #fff;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    transition: background-color 0.3s;
}

body.dark {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

body.light {
    background-color: var(--bg-light);
    color: var(--text-light);
}

/* ===== HEADER CONTROLS ===== */
.header-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.control-btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

body.dark .control-btn {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

body.light .control-btn {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    color: #333;
}

.control-btn:hover {
    transform: scale(1.05);
}

/* ===== LEFT PANEL (STARS/SKY) ===== */
.left-panel {
    display: none;
    width: 50%;
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .left-panel {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Dark theme - Starry night */
body.dark .left-panel {
    background: linear-gradient(to bottom, #0a0a12, #0d0d18, #0a0a12);
}

/* Light theme - Mountain sky */
body.light .left-panel {
    background: linear-gradient(to bottom, 
        #7EC8E3 0%, #9DD5EC 15%, #B8E0F0 30%,
        #D4EAF4 45%, #E8E8E4 55%, #F2DDD0 65%,
        #EECFC0 75%, #E5C0B0 85%, #D4A898 100%
    );
}

.stars-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

body.light .stars-container {
    display: none;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

.quote-container {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    max-width: 500px;
}

.quote-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 2rem;
    opacity: 0.3;
}

body.dark .quote-icon { color: white; }
body.light .quote-icon { color: #334155; }

.quote-text {
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 1rem;
    transition: opacity 0.5s, transform 0.5s;
}

body.dark .quote-text { color: rgba(255,255,255,0.85); }
body.light .quote-text { color: #1e293b; }

.quote-author {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: opacity 0.5s;
}

body.dark .quote-author { color: rgba(255,255,255,0.5); }
body.light .quote-author { color: rgba(71,85,105,0.8); }

.quote-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 2rem;
}

.quote-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

body.dark .quote-dot {
    background: rgba(255,255,255,0.2);
}
body.dark .quote-dot.active {
    background: rgba(255,255,255,0.6);
    width: 16px;
    border-radius: 3px;
}

body.light .quote-dot {
    background: rgba(71,85,105,0.3);
}
body.light .quote-dot.active {
    background: rgba(71,85,105,0.6);
    width: 16px;
    border-radius: 3px;
}

/* Mountains for light theme */
.mountains {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45%;
    display: none;
}

body.light .mountains { display: block; }

/* ===== RIGHT PANEL (FORM) ===== */
.right-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

@media (min-width: 1024px) {
    .right-panel {
        width: 50%;
    }
}

body.dark .right-panel {
    background: #18181b;
}

body.light .right-panel {
    background: #fafaf9;
}

.form-container {
    width: 100%;
    max-width: 400px;
    transition: max-width 0.3s;
}

.form-container.wide {
    max-width: 680px;
}

.signup-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 640px) {
    .signup-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0 20px;
    }
    .signup-grid .form-group.full-width {
        grid-column: 1 / -1;
    }
    .signup-grid.single-col {
        grid-template-columns: 1fr;
    }
}

/* Logo */
.logo-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-img {
    width: 120px;
    height: auto;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.logo-slogan {
    font-size: 0.875rem;
    font-style: italic;
}

body.dark .logo-slogan { color: var(--text-muted-dark); }
body.light .logo-slogan { color: var(--text-muted-light); }

/* Form card */
.form-card {
    border-radius: 24px 24px 0 0;
    padding: 1.5rem;
}

body.dark .form-card { background: var(--bg-card-dark); }
body.light .form-card { background: var(--bg-card-light); }

.form-footer {
    border-radius: 0 0 24px 24px;
    padding: 1rem 1.5rem;
    text-align: center;
}

body.dark .form-footer { background: var(--bg-card-dark); }
body.light .form-footer { background: var(--bg-card-light); }

.form-footer p {
    font-size: 0.75rem;
    opacity: 0.5;
}

/* Mode toggle */
.mode-toggle {
    display: flex;
    background: rgba(128,128,128,0.2);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 2rem;
    position: relative;
}

.mode-toggle-slider {
    position: absolute;
    top: 6px;
    bottom: 6px;
    width: calc(50% - 6px);
    border-radius: 8px;
    transition: all 0.4s ease;
}

body.dark .mode-toggle-slider { background: #27272a; }
body.light .mode-toggle-slider { background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.mode-toggle-slider.signup {
    left: calc(50% + 3px);
}

.mode-toggle-slider.login {
    left: 6px;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
    transition: color 0.3s;
}

body.dark .mode-btn { color: var(--text-muted-dark); }
body.dark .mode-btn.active { color: var(--text-dark); }
body.light .mode-btn { color: var(--text-muted-light); }
body.light .mode-btn.active { color: var(--text-light); }

/* Form fields */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group.hidden, .forgot-password.hidden, .terms-checkbox.hidden {
    display: none;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

body.dark .form-label { color: var(--text-muted-dark); }
body.light .form-label { color: var(--text-muted-light); }

.input-wrapper {
    position: relative;
    overflow: hidden;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

.form-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 12px 12px 40px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 1rem;
    transition: border-color 0.3s, background-color 0.3s;
}

body.dark .form-input {
    background: var(--input-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

body.light .form-input {
    background: var(--input-light);
    border-color: var(--border-light);
    color: var(--text-light);
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Fix browser autofill overriding dark mode colors */
body.dark .form-input:-webkit-autofill,
body.dark .form-input:-webkit-autofill:hover,
body.dark .form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--input-dark) inset !important;
    -webkit-text-fill-color: var(--text-dark) !important;
    border-color: var(--border-dark) !important;
    transition: background-color 5000s ease-in-out 0s;
}

body.light .form-input:-webkit-autofill,
body.light .form-input:-webkit-autofill:hover,
body.light .form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--input-light) inset !important;
    -webkit-text-fill-color: var(--text-light) !important;
    border-color: var(--border-light) !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    padding: 4px;
}

.password-toggle:hover { opacity: 1; }

.forgot-password {
    text-align: right;
    margin-bottom: 1.25rem;
}

.forgot-password a {
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.3s;
}

body.dark .forgot-password a { color: var(--text-muted-dark); }
body.dark .forgot-password a:hover { color: var(--text-dark); }
body.light .forgot-password a { color: var(--text-muted-light); }
body.light .forgot-password a:hover { color: var(--text-light); }

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

body.dark .btn-primary {
    background: var(--text-dark);
    color: var(--bg-dark);
}

body.light .btn-primary {
    background: var(--text-light);
    color: var(--bg-light);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-google {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    background: transparent;
}

body.dark .btn-google {
    border: 1px solid var(--border-dark);
    color: var(--text-dark);
}

body.light .btn-google {
    border: 1px solid var(--border-light);
    color: var(--text-light);
}

.btn-google:hover {
    background: rgba(128,128,128,0.1);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Terms */
.terms-text {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    text-align: center;
}

body.dark .terms-text { color: var(--text-muted-dark); }
body.light .terms-text { color: var(--text-muted-light); }

.terms-text a {
    text-decoration: underline;
}

body.dark .terms-text a { color: var(--text-muted-dark); }
body.light .terms-text a { color: var(--text-muted-light); }

/* Messages */
.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

.message.error {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
    display: block;
}

.message.success {
    background: rgba(34,197,94,0.1);
    color: #22c55e;
    border: 1px solid rgba(34,197,94,0.3);
    display: block;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.password-strength.hidden { display: none; }
.strength-bar {
    flex: 1;
    height: 4px;
    background: rgba(128,128,128,0.3);
    border-radius: 2px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background 0.3s;
    border-radius: 2px;
}
.strength-fill.weak { width: 33%; background: #ef4444; }
.strength-fill.medium { width: 66%; background: #f59e0b; }
.strength-fill.strong { width: 100%; background: #22c55e; }
.strength-text {
    font-size: 11px;
    min-width: 50px;
}
.strength-text.weak { color: #ef4444; }
.strength-text.medium { color: #f59e0b; }
.strength-text.strong { color: #22c55e; }

/* ===== ROLE TOGGLE (Cliente / Piloto) ===== */
.role-toggle {
    display: flex;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1rem;
    position: relative;
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.05);
}

.role-toggle-slider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: calc(50% - 4px);
    border-radius: 9px;
    transition: all 0.4s ease;
}

.role-toggle-slider.client { left: 4px; }
.role-toggle-slider.pilot { left: calc(50% + 1px); }

body.dark .role-toggle-slider { background: rgba(59, 130, 246, 0.25); }
body.light .role-toggle-slider { background: rgba(59, 130, 246, 0.15); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

.role-btn {
    flex: 1;
    padding: 8px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: color 0.3s;
    letter-spacing: 0.3px;
}

body.dark .role-btn { color: var(--text-muted-dark); }
body.dark .role-btn.active { color: #60a5fa; }
body.light .role-btn { color: var(--text-muted-light); }
body.light .role-btn.active { color: #2563eb; }

/* ===== VEHICLE SECTION ===== */
.vehicle-section-header {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 10px 0 12px;
    margin-bottom: 12px;
    border-top: 1px solid rgba(128,128,128,0.2);
}

body.dark .vehicle-section-header { color: #60a5fa; border-top-color: rgba(96,165,250,0.2); }
body.light .vehicle-section-header { color: #2563eb; border-top-color: rgba(37,99,235,0.15); }

.vehicle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}

.vehicle-grid .form-group {
    margin-bottom: 0;
}

.vehicle-grid .form-label {
    font-size: 0.72rem;
    margin-bottom: 4px;
}

.vehicle-grid .form-input {
    padding: 8px 10px;
    font-size: 0.82rem;
}

/* Wider form container for pilot signup */
.form-container.wide-pilot {
    max-width: 520px;
}

/* Address autocomplete suggestions */
.addr-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 50;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid rgba(128,128,128,0.25);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

body:not(.dark) .addr-suggestions {
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.addr-sug-item {
    padding: 10px 14px;
    font-size: 0.82rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(128,128,128,0.1);
    transition: background 0.15s;
}

.addr-sug-item:last-child { border-bottom: none; }

.addr-sug-item:hover {
    background: rgba(2,123,255,0.12);
}

#direccionGroup {
    position: relative;
}

@media (max-width: 768px) {
    .vehicle-grid {
        grid-template-columns: 1fr;
    }
}
