/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1a3a5f;
    --secondary-blue: #2c5f8d;
    --accent-blue: #4a9eff;
    --dark-grey: #2c2c2c;
    --light-grey: #f5f5f5;
    --white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --success-green: #28a745;
    --error-red: #dc3545;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: linear-gradient(135deg, var(--light-grey) 0%, #e8e8e8 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--primary-blue);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    max-height: 60px;
    width: auto;
}

.back-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.back-link:hover {
    color: var(--accent-blue);
}

/* Form Section */
.form-section {
    padding: 60px 0;
}

.form-wrapper {
    background: var(--white);
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-align: center;
    margin-bottom: 10px;
}

.form-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.form-group input {
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: var(--white);
    /* Mejoras para móviles */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Prevenir zoom en iOS */
    font-size: 16px; /* iOS no hace zoom si el font-size es >= 16px */
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

/* Mejoras específicas para iOS */
@supports (-webkit-touch-callout: none) {
    .form-group input {
        font-size: 16px; /* Prevenir zoom automático en iOS */
    }
    
    .form-group input[type="tel"] {
        font-size: 16px;
    }
}

.form-group input.error {
    border-color: var(--error-red);
}

.error-message {
    color: var(--error-red);
    font-size: 0.875rem;
    display: none;
}

.error-message.show {
    display: block;
}

.form-hint {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: -5px;
}

/* Google Places Autocomplete Styling */
.pac-container {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    margin-top: 5px;
    z-index: 10000 !important; /* Asegurar que aparezca sobre otros elementos */
    font-family: 'Inter', sans-serif;
}

.pac-item {
    padding: 12px;
    font-family: 'Inter', sans-serif;
    border-top: 1px solid #eee;
    cursor: pointer;
    /* Mejoras para móviles */
    -webkit-tap-highlight-color: rgba(74, 158, 255, 0.2);
    min-height: 44px; /* Tamaño mínimo táctil recomendado */
    display: flex;
    align-items: center;
}

.pac-item:hover,
.pac-item:focus {
    background-color: var(--light-grey);
}

.pac-item-selected {
    background-color: var(--accent-blue);
    color: var(--white);
}

/* Mejoras para iOS Safari */
@supports (-webkit-touch-callout: none) {
    .pac-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .pac-item {
        -webkit-tap-highlight-color: rgba(74, 158, 255, 0.3);
    }
}

/* Submit Button */
.btn-submit {
    padding: 16px 40px;
    background: var(--accent-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
}

.btn-submit:hover:not(:disabled) {
    background: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Success/Error Messages */
.success-message,
.error-message {
    text-align: center;
    padding: 30px;
    border-radius: 8px;
    margin-top: 30px;
}

.success-message {
    background: #d4edda;
    border: 2px solid var(--success-green);
    color: #155724;
}

.error-message {
    background: #f8d7da;
    border: 2px solid var(--error-red);
    color: #721c24;
}

.success-icon,
.error-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.success-message h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--success-green);
}

/* Footer */
.footer {
    background: var(--dark-grey);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
}

.footer-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.footer-phone {
    font-size: 1.1rem;
    color: var(--accent-blue);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        max-height: 50px;
    }

    .form-section {
        padding: 40px 0;
    }

    .form-wrapper {
        padding: 30px 20px;
        margin: 0 10px;
    }

    .form-title {
        font-size: 2rem;
    }

    .form-subtitle {
        font-size: 1rem;
    }

    .contact-form {
        gap: 20px;
    }

    .btn-submit {
        width: 100%;
        padding: 14px 30px;
    }
}

@media (max-width: 480px) {
    .form-title {
        font-size: 1.75rem;
    }

    .form-wrapper {
        padding: 25px 15px;
    }
    
    /* Mejoras adicionales para móviles pequeños */
    .form-group input {
        padding: 12px 14px;
        font-size: 16px; /* Prevenir zoom en iOS */
    }
    
    .btn-submit {
        padding: 14px 30px;
        font-size: 1rem;
        width: 100%;
    }
}

/* Mejoras específicas para iOS */
@supports (-webkit-touch-callout: none) {
    /* Prevenir zoom al hacer focus en inputs */
    input[type="text"],
    input[type="tel"] {
        font-size: 16px !important;
    }
    
    /* Mejorar scroll en iOS */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mejorar botones en iOS */
    .btn-submit {
        -webkit-tap-highlight-color: rgba(74, 158, 255, 0.3);
        min-height: 44px; /* Tamaño mínimo táctil */
    }
}
