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

:root {
    --primary-color: #f47e3c;
    --primary-dark: #e36921;
    --primary-light: #ff9659;
    --background: #0a0a0a;
    --surface: #1a1a1a;
    --surface-elevated: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --error: #ff6b6b;
    --success: #51cf66;
    --border: #333333;
    --border-light: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.5s ease-in;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 16px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border);
}

.logo {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

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

.title {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Form */
.form {
    background: var(--surface);
    padding: 32px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 24px;
}

.label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.required {
    color: var(--error);
}

.input,
.textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface-elevated);
    box-shadow: 0 0 0 4px rgba(244, 126, 60, 0.2);
}

.input::placeholder,
.textarea::placeholder {
    color: #666;
}

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

.input.error,
.textarea.error {
    border-color: var(--error);
}

.error-message {
    display: block;
    font-size: 13px;
    color: var(--error);
    margin-top: 6px;
    min-height: 18px;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(244, 126, 60, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 126, 60, 0.4);
}

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

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

.btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.loader {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.submit-btn.loading .loader {
    display: block;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Success Message */
.success-message {
    background: var(--surface);
    padding: 48px 24px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message.hidden {
    display: none;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-message h2 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.success-message p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.hidden {
    display: none !important;
}

/* Responsive Design - Mobile First */
@media (max-width: 640px) {
    .container {
        padding: 12px;
    }
    
    .header {
        padding: 20px 12px;
        margin-bottom: 24px;
    }
    
    .logo {
        width: 64px;
        height: 64px;
    }
    
    .title {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .form {
        padding: 24px 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .input,
    .textarea {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .submit-btn {
        padding: 14px 24px;
        font-size: 16px;
    }
    
    .success-message {
        padding: 32px 16px;
    }
    
    .success-icon {
        width: 64px;
        height: 64px;
        font-size: 36px;
    }
    
    .success-message h2 {
        font-size: 24px;
    }
}

@media (max-width: 400px) {
    .title {
        font-size: 24px;
    }
    
    .logo {
        width: 56px;
        height: 56px;
    }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
    .container {
        padding: 24px;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Estados de carga y error mejorados */
.input:invalid:not(:placeholder-shown) {
    border-color: var(--error);
}

.input:valid:not(:placeholder-shown) {
    border-color: var(--success);
}
