:root {
    --primary: #244578;
    --primary-light: #345a96;
    --accent: #FFC947;
    --accent-hover: #eeb835;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-main: #244578;
    --text-muted: #64748b;
    --border-color: rgba(36, 69, 120, 0.15);
    --input-bg: #f8fafc;
    --radius: 16px;
    --shadow: 0 10px 25px -5px rgba(36, 69, 120, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(36, 69, 120, 0.2);
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9;
    background-image: radial-gradient(at 0% 0%, rgba(36, 69, 120, 0.05) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(255, 201, 71, 0.1) 0px, transparent 50%);
    color: var(--text-dark);
    min-height: 100vh;
    padding: 3rem 1rem;
    line-height: 1.6;
}

/* Background Elements */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(100px);
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    opacity: 0.1;
}

.blob-1 { background: var(--primary); top: -10%; left: -10%; animation: move 20s infinite alternate; }
.blob-2 { background: var(--accent); bottom: -10%; right: -10%; animation: move 25s infinite alternate-reverse; }

@keyframes move {
    from { transform: translate(0, 0); }
    to { transform: translate(100px, 100px); }
}

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
}

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

.header {
    text-align: center;
    margin-bottom: 4rem;
}

.header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--primary);
    letter-spacing: -0.025em;
}

.header p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 3.5rem;
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 2rem;
}

.form-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.form-section h2::after {
    content: '';
    flex-grow: 1;
    height: 2px;
    background: linear-gradient(to right, var(--accent), transparent);
    margin-left: 1.5rem;
    opacity: 0.5;
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

input, select, textarea {
    width: 100%;
    background: var(--input-bg);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.875rem 1.25rem;
    color: var(--text-dark);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 201, 71, 0.2);
    background: #ffffff;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23244578'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.1rem;
    padding-right: 3rem;
}

.radio-group {
    display: flex;
    gap: 2rem;
    padding: 0.5rem 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-transform: none;
    font-size: 1rem;
    color: var(--text-dark);
    letter-spacing: normal;
}

.radio-label input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
}

.legal-text {
    background: #f1f5f9;
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 4px 12px 12px 4px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.beneficiary-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.beneficiary-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.beneficiary-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.btn-primary {
    background: var(--accent);
    color: var(--primary);
    border: none;
    border-radius: 12px;
    padding: 1.25rem 3.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 15px -3px rgba(255, 201, 71, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-4px);
    box-shadow: 0 15px 25px -5px rgba(255, 201, 71, 0.4);
}

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

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    background: var(--primary);
    color: var(--accent);
    padding: 1.25rem 3rem;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(36, 69, 120, 0.3);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.error-msg {
    color: var(--error);
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 1rem;
    text-align: center;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Spinner para estado de carga */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(36, 69, 120, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.btn-primary:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
