/* auth.css: Styles for authentication page */

body {
    background: #f6fafd;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Video background and overlay (copied from landing-landing.css) */
.bg-video {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
  opacity: 0.3;
}
.bg-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 1;
  pointer-events: none;
}

.auth-container {
    max-width: 500px;
    width: 90%;
    margin: 20px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 24px 20px;
    position: relative;
    z-index: 2;
}

.auth-container h1 {
    text-align: center;
    color: #0077b6;
    margin-bottom: 24px;
    font-size: 1.8em;
    line-height: 1.2;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.auth-tabs button {
    background: none;
    border: none;
    font-size: 1.1em;
    padding: 10px 24px;
    cursor: pointer;
    color: #0077b6;
    border-bottom: 2px solid transparent;
    transition: border 0.2s, color 0.2s;
}

.auth-tabs button.active {
    border-bottom: 2px solid #0077b6;
    color: #023e8a;
    font-weight: bold;
}

.signup-role-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.signup-role-tabs button {
    background: none;
    border: none;
    font-size: 1em;
    padding: 8px 18px;
    cursor: pointer;
    color: #0096c7;
    border-bottom: 2px solid transparent;
    transition: border 0.2s, color 0.2s;
}

.signup-role-tabs button.active {
    border-bottom: 2px solid #0096c7;
    color: #023e8a;
    font-weight: bold;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.auth-form label {
    font-size: 0.95em;
    color: #333;
    margin-bottom: 4px;
    width: 100%;
    text-align: left;
    font-weight: 500;
}

.auth-form input, .auth-form select {
    padding: 12px 10px;
    border: 1px solid #bde0fe;
    border-radius: 8px;
    font-size: 1em;
    margin-top: 2px;
    margin-bottom: 4px;
    background: #f6fafd;
    transition: border 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

.auth-form input:focus, .auth-form select:focus {
    border-color: #0077b6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

.auth-form button[type="submit"] {
    background: linear-gradient(90deg, #00b4d8 0%, #48cae4 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 0;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
    display: block;
}

.auth-form button[type="submit"]:hover {
    background: linear-gradient(90deg, #0096c7 0%, #00b4d8 100%);
    transform: translateY(-1px);
}

.auth-form button[type="submit"]:active {
    transform: translateY(0);
}

/* Loading, success, and error states for buttons */
.auth-form button[type="submit"].loading {
    background: linear-gradient(90deg, #6c757d 0%, #adb5bd 100%);
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.auth-form button[type="submit"].loading:hover {
    background: linear-gradient(90deg, #6c757d 0%, #adb5bd 100%);
    transform: none;
}

.auth-form button[type="submit"].loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.auth-form button[type="submit"].success {
    background: linear-gradient(90deg, #28a745 0%, #34ce57 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.auth-form button[type="submit"].error {
    background: linear-gradient(90deg, #dc3545 0%, #e74c3c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: errorShake 0.6s ease-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Spinner animation */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff40;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success and error icons */
.check-icon, .error-icon {
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.check-icon {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: checkBounce 0.6s ease-out;
}

@keyframes checkBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.error-icon {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: errorBounce 0.6s ease-out;
}

@keyframes errorBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Error message styling */
.error-message {
    margin-top: 12px;
    padding: 12px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    animation: slideIn 0.3s ease-out;
}

.error-message .error-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message .error-icon {
    background: none;
    color: #721c24;
    width: auto;
    height: auto;
    animation: none;
}

.error-message .error-text {
    font-size: 0.9em;
    line-height: 1.4;
}

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

/* Input validation states */
.auth-form input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
    animation: inputShake 0.4s ease-out;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.auth-form input.success {
    border-color: #28a745;
    background-color: #f0fff4;
}

/* Focus states with better visual feedback */
.auth-form input:focus, .auth-form select:focus {
    border-color: #0077b6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
    background: #ffffff;
}

/* Loading overlay for forms with geocoding */
.auth-form.geocoding {
    position: relative;
}

.auth-form.geocoding::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    border-radius: 8px;
}

.auth-form.geocoding::after {
    content: '🗺️ Verificando endereço...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    background: rgba(0, 119, 182, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    white-space: nowrap;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
}

.auth-switch a {
    color: #0077b6;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.95em;
    transition: color 0.2s;
}

.auth-switch a:hover {
    color: #023e8a;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    .auth-container {
        width: 95%;
        margin: 15px auto;
        padding: 20px 16px;
    }
    
    .auth-container h1 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }
    
    .auth-form {
        gap: 10px;
    }
    
    .auth-form input, .auth-form select {
        padding: 10px 8px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .auth-form button[type="submit"] {
        padding: 12px 0;
        font-size: 1em;
    }
    
    .auth-tabs button {
        font-size: 1em;
        padding: 8px 16px;
    }
    
    .signup-role-tabs button {
        font-size: 0.9em;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        width: 98%;
        margin: 10px auto;
        padding: 16px 12px;
        border-radius: 8px;
    }
    
    .auth-container h1 {
        font-size: 1.4em;
        margin-bottom: 16px;
    }
    
    .auth-form {
        gap: 8px;
    }
    
    .auth-form label {
        font-size: 0.9em;
    }
    
    .auth-form input, .auth-form select {
        padding: 8px 6px;
        border-radius: 6px;
    }
    
    .auth-form button[type="submit"] {
        padding: 10px 0;
        border-radius: 6px;
    }
    
    .auth-tabs button {
        font-size: 0.9em;
        padding: 6px 12px;
    }
    
    .signup-role-tabs button {
        font-size: 0.85em;
        padding: 4px 8px;
    }
    
    .auth-switch {
        margin-top: 12px;
    }
    
    .auth-switch a {
        font-size: 0.9em;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-container {
        margin: 10px auto;
        padding: 16px 20px;
    }
    
    .auth-container h1 {
        font-size: 1.3em;
        margin-bottom: 12px;
    }
    
    .auth-form {
        gap: 6px;
    }
    
    .auth-form input, .auth-form select {
        padding: 6px 8px;
        margin-bottom: 2px;
    }
    
    .auth-form button[type="submit"] {
        padding: 8px 0;
        margin-top: 8px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .auth-form input, .auth-form select {
        border-width: 0.5px;
    }
}

/* Terms acceptance styling */
.terms-acceptance {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9em;
    line-height: 1.4;
    color: #495057;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #0077b6;
}

.checkbox-label a {
    color: #0077b6;
    text-decoration: none;
    font-weight: 500;
}

.checkbox-label a:hover {
    text-decoration: underline;
    color: #023e8a;
} 