/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
    padding: 20px;
}

/* Contenedor principal */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Header */
.form-header {
    background-color: #e8f5e9;
    padding: 20px 30px;
    border-bottom: 2px solid #c8e6c9;
}

.form-header h1 {
    font-size: 1.5rem;
    color: #2e7d32;
    font-weight: 600;
}

/* Formulario */
form {
    padding: 25px 30px;
}

/* Filas */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group.half {
    flex: 1;
    min-width: 0;
}

.form-group.full {
    flex: 1;
    width: 100%;
}

/* Etiquetas */
label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d5a3d;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

label .icon {
    color: #90a4ae;
    flex-shrink: 0;
}

.required {
    color: #c62828;
}

/* Inputs y Selects */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.9rem;
    color: #555;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

input::placeholder,
textarea::placeholder {
    color: #bbb;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #66bb6a;
    box-shadow: 0 0 0 2px rgba(102, 187, 106, 0.15);
}

select:disabled {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

/* Select wrapper para la flecha */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #888;
    pointer-events: none;
}

.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px;
}

/* Input de teléfono */
.phone-input {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 3px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-input:focus-within {
    border-color: #66bb6a;
    box-shadow: 0 0 0 2px rgba(102, 187, 106, 0.15);
}

.phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background-color: #f5f5f5;
    color: #888;
    font-size: 0.9rem;
    border-right: 1px solid #ccc;
    flex-shrink: 0;
}

.phone-input input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.phone-input input:focus {
    box-shadow: none;
}

/* Input de email */
.email-input {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding-left: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.email-input:focus-within {
    border-color: #66bb6a;
    box-shadow: 0 0 0 2px rgba(102, 187, 106, 0.15);
}

.email-input .input-icon {
    color: #888;
    margin-right: 8px;
    flex-shrink: 0;
}

.email-input input {
    border: none;
    border-radius: 0;
    padding-left: 0;
    flex: 1;
}

.email-input input:focus {
    box-shadow: none;
}

/* Textarea */
textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* File upload */
.file-upload {
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 12px 15px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    background-color: #fafafa;
}

.file-upload:hover {
    border-color: #66bb6a;
    background-color: #f1f8e9;
}

.file-upload-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-icon {
    color: #888;
}

.upload-text {
    color: #66bb6a;
    font-weight: 500;
    font-size: 0.9rem;
}

.upload-hint {
    color: #bbb;
    font-size: 0.85rem;
}

.file-help {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    margin-top: 6px;
}

.file-name {
    font-size: 0.85rem;
    color: #2e7d32;
    margin-top: 4px;
    font-weight: 500;
}

/* Botón enviar */
.submit-btn {
    background-color: #43a047;
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #388e3c;
}

.submit-btn:active {
    transform: translateY(1px);
}

/* Responsive */
@media (max-width: 640px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-header {
        padding: 15px 20px;
    }
    
    form {
        padding: 20px;
    }
    
    .submit-btn {
        width: 100%;
    }
}

/* Estados de validación */
input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown) {
    border-color: #e57373;
}

input:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown) {
    border-color: #81c784;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    transform: scale(0.92);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.modal-icon.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.modal-icon.success::before {
    content: '✓';
}

.modal-icon.error {
    background: #ffebee;
    color: #c62828;
}

.modal-icon.error::before {
    content: '✕';
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.modal-message {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-btn {
    background: #43a047;
    color: #fff;
    border: none;
    padding: 12px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn:hover {
    background: #388e3c;
}

.modal-btn:active {
    transform: translateY(1px);
}
input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown) {
    border-color: #e57373;
}

input:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown) {
    border-color: #81c784;
}
