/**
 * TRANSPORT GARCÍA - ESTILOS DE FORMULARIOS
 * Diseño responsive con layout de 2 columnas
 */

/* ==========================================================================
   FUENTES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* ==========================================================================
   VARIABLES
   ========================================================================== */
:root {
    --color-primary: #8B4513;
    --color-primary-dark: #6B3410;
    --color-primary-light: #A0522D;
    --color-secondary: #333;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #17a2b8;
    
    --bg-dark: rgba(30, 30, 30, 0.95);
    --bg-light: rgba(255, 255, 255, 0.95);
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--color-secondary);
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL
   ========================================================================== */
.tg-form-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #CD853F 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 40px 20px;
    position: relative;
}

.tg-form-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,218.7C672,203,768,149,864,128C960,107,1056,117,1152,133.3C1248,149,1344,171,1392,181.3L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    pointer-events: none;
}

.tg-form-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 550px 1fr;
    gap: 30px;
    align-items: start;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   COLUMNA IZQUIERDA - FORMULARIO
   ========================================================================== */
.tg-form-column {
    background: var(--bg-dark);
    padding: 40px 35px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.tg-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tg-form-header h2 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.tg-form-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* ==========================================================================
   CAMPOS DEL FORMULARIO
   ========================================================================== */
.tg-form-group {
    margin-bottom: 24px;
}

.tg-form-label {
    display: block;
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tg-form-label .required {
    color: var(--color-danger);
    margin-left: 3px;
}

.tg-form-input,
.tg-form-select,
.tg-form-textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
    background: white;
    color: var(--color-secondary);
    transition: var(--transition);
}

.tg-form-input:focus,
.tg-form-select:focus,
.tg-form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.tg-form-input::placeholder {
    color: #999;
}

.tg-form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Selects personalizados */
.tg-form-select {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23333" d="M6 9L1 4h10z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Radio buttons personalizados */
.tg-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tg-radio-option {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.tg-radio-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tg-radio-option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.tg-radio-option input[type="radio"]:checked {
    border-color: var(--color-primary);
    background: white;
}

.tg-radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tg-radio-option input[type="radio"]:checked ~ label {
    color: white;
    font-weight: 600;
}

.tg-radio-option label {
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 15px;
}

/* Checkbox personalizado */
.tg-checkbox-wrapper {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.tg-checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.tg-checkbox-wrapper input[type="checkbox"]:checked {
    background: var(--color-success);
    border-color: var(--color-success);
}

.tg-checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tg-checkbox-wrapper label {
    color: white;
    font-size: 14px;
    cursor: pointer;
}

/* Toggle nocturno */
.tg-toggle-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: var(--border-radius);
    margin: 15px 0;
}

.tg-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    margin-right: 12px;
}

.tg-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.tg-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: var(--transition);
    border-radius: 34px;
}

.tg-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

.tg-toggle input:checked + .tg-toggle-slider {
    background-color: var(--color-warning);
}

.tg-toggle input:checked + .tg-toggle-slider:before {
    transform: translateX(24px);
}

.tg-toggle-label {
    color: white;
    font-size: 14px;
}

.tg-toggle-info {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-top: 5px;
    margin-left: 62px;
}

/* Google Maps Autocomplete */
.pac-container {
    font-family: 'Montserrat', sans-serif;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-top: 5px;
}

/* ==========================================================================
   COLUMNA DERECHA - RESUMEN
   ========================================================================== */
.tg-summary-column {
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 20px;
}

.tg-summary-header {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.tg-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tg-summary-item:last-child {
    border-bottom: none;
}

.tg-summary-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.tg-summary-value {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.tg-summary-total {
    background: var(--color-primary);
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    text-align: center;
}

.tg-summary-total-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 5px;
}

.tg-summary-total-amount {
    color: white;
    font-size: 36px;
    font-weight: 700;
}

/* Código de descuento */
.tg-discount-wrapper {
    margin: 20px 0;
}

.tg-discount-input-group {
    display: flex;
    gap: 10px;
}

.tg-discount-input-group input {
    flex: 1;
}

.tg-discount-btn {
    padding: 14px 20px;
    background: var(--color-warning);
    color: var(--color-secondary);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tg-discount-btn:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.tg-discount-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: var(--border-radius);
    font-size: 13px;
}

.tg-discount-message.success {
    background: rgba(40, 167, 69, 0.2);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.tg-discount-message.error {
    background: rgba(220, 53, 69, 0.2);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.tg-btn {
    width: 100%;
    padding: 16px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.tg-btn-primary {
    background: white;
    color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.tg-btn-primary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

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

.tg-btn-success {
    background: var(--color-success);
    color: white;
}

.tg-btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.tg-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading spinner */
.tg-btn-loading {
    position: relative;
    pointer-events: none;
}

.tg-btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

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

/* ==========================================================================
   MENSAJES Y ALERTAS
   ========================================================================== */
.tg-alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    font-size: 14px;
}

.tg-alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.tg-alert-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

.tg-alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border: 1px solid var(--color-warning);
}

.tg-alert-info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--color-info);
    border: 1px solid var(--color-info);
}

/* ==========================================================================
   STRIPE ELEMENTS
   ========================================================================== */
#card-element {
    background: white;
    padding: 14px 18px;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    transition: var(--transition);
}

#card-element.StripeElement--focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

#card-element.StripeElement--invalid {
    border-color: var(--color-danger);
}

#card-errors {
    color: var(--color-danger);
    font-size: 13px;
    margin-top: 8px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1200px) {
    .tg-form-container {
        grid-template-columns: 500px 1fr;
        gap: 25px;
    }
}

@media (max-width: 992px) {
    .tg-form-container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    .tg-summary-column {
        position: static;
    }
}

@media (max-width: 768px) {
    .tg-form-wrapper {
        padding: 20px 15px;
    }
    
    .tg-form-column,
    .tg-summary-column {
        padding: 25px 20px;
    }
    
    .tg-form-header h2 {
        font-size: 24px;
    }
    
    .tg-summary-total-amount {
        font-size: 28px;
    }
    
    .tg-discount-input-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .tg-form-column,
    .tg-summary-column {
        padding: 20px 15px;
    }
    
    .tg-form-input,
    .tg-form-select,
    .tg-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tg-fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ==========================================================================
   UTILIDADES
   ========================================================================== */
.tg-text-center {
    text-align: center;
}

.tg-mt-20 {
    margin-top: 20px;
}

.tg-mb-20 {
    margin-bottom: 20px;
}

.tg-hidden {
    display: none !important;
}

.tg-visible {
    display: block !important;
}
