:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --accent: #4cc9f0;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #94a3b8;
    --gradient: linear-gradient(135deg, #4361ee, #7209b7);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 16px;
    color: var(--dark);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Header */
.header {
    background: var(--gradient);
    color: white;
    padding: 32px 24px;
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    color: white;
    font-size: 1.2rem;
    text-decoration: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255,255,255,0.2);
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
main {
    padding: 24px;
}

/* Aliados Grid */
.aliados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.aliado-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0,0,0,0.05);
}

.aliado-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.disglobal-bg { background: linear-gradient(135deg, #234985, #1e40af); }
.vepagos-bg { background: linear-gradient(135deg,#2ae23a, #2aa148); }
.master-bg { background: linear-gradient(135deg, #0caf79, #047857 ); }
.credicard-bg { background: linear-gradient(135deg, #f59e0b, #b45309 ); }

.card-content {
    padding: 16px;
}

.card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.card-content p {
    font-size: 0.875rem;
    color: var(--gray);
    margin-bottom: 12px;
}

.card-link {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* QR Scanner Section */
.qr-scanner-section {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #f5f7fa, #e4e8f0);
    border-radius: var(--radius-md);
}

.qr-scanner-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qr-scanner-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.qr-hint {
    margin-top: 12px;
    color: var(--gray);
    font-size: 0.875rem;
}

/* Form Styles */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
}

.form-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 12px;
}

.form-section h4 {
    color: var(--dark);
    margin: 16px 0 12px;
    font-size: 1rem;
}

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

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

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dark);
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

input[readonly] {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
    padding: 8px 16px;
    background: #f8fafc;
    border-radius: 30px;
    transition: all 0.2s;
}

.radio-label:hover {
    background: #e2e8f0;
}

.radio-label input[type="radio"] {
    width: auto;
    margin-right: 4px;
}

/* Info Box */
.info-box {
    background: #f0f9ff;
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    color: var(--dark);
}

.info-box p {
    margin: 0;
    font-weight: 500;
}

/* Signature Section */
.signature-section {
    background: #f8fafc;
}

.signature-container, .fingerprint-container {
    background: white;
    border: 2px dashed var(--primary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.signature-canvas, .fingerprint-canvas {
    width: 100%;
    height: auto;
    max-width: 400px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: rgb(177, 175, 175);
    cursor: crosshair;
    touch-action: none;
}

.fingerprint-canvas {
    max-width: 200px;
    height: auto;
    margin: 0 auto;
}

.signature-controls {
    margin-top: 12px;
}

.btn-secondary {
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* Form Actions */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 32px 0;
    justify-content: center;
}

.btn-primary, .btn-whatsapp {
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--gradient);
    color: white;
    flex: 1;
    min-width: 200px;
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    flex: 1;
    min-width: 200px;
}

.btn-whatsapp:hover {
    background: #128C7E;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Footer */
footer {
    text-align: center;
    padding: 24px;
    background: #f8fafc;
    color: var(--gray);
    font-size: 0.875rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        border-radius: var(--radius-md);
    }
    
    .header {
        padding: 24px 16px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-section {
        padding: 16px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .radio-label {
        width: 100%;
    }
    
    .btn-primary, .btn-whatsapp {
        width: 100%;
    }
    
    .signature-canvas {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .aliados-grid {
        grid-template-columns: 1fr;
    }
    
    .logo-container {
        flex-direction: column;
        gap: 4px;
    }
    
    .back-btn {
        position: relative;
        margin-bottom: 10px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-whatsapp {
        min-width: 100%;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-section {
    animation: fadeIn 0.5s ease-out;
}

