* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 2rem;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

h1, h2 {
    margin-top: 0;
    color: #1a1a1a;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

label .required {
    color: #c00;
}

input, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn:hover {
    background: #1d4ed8;
}

.btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.biometric-container {
    min-height: 580px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-message {
    text-align: center;
    padding: 2rem;
}

.loading-message p {
    color: #64748b;
    margin-bottom: 1rem;
}

.spinner-border {
    width: 2rem;
    height: 2rem;
    border: 2px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error-message-box {
    text-align: center;
    padding: 2rem;
    background: #fef2f2;
    border-radius: 8px;
    color: #991b1b;
}

.error-message-box h3 {
    color: #991b1b;
    margin-bottom: 0.5rem;
}

.footer-info {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
}

#biometria {
    width: 100%;
    min-height: 580px;
}

/* Contenedor iframe biométrico - como Camerfirma, más compacto */
body.page-validate {
    padding: 0.5rem;
}

.container-validate {
    max-width: 100%;
    width: 100%;
    padding: 0.75rem 1rem;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
}

.container-validate h1 {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

.container-validate .footer-info {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.biometric-sdk-wrap {
    width: 100%;
    min-height: 650px;
    height: calc(100vh - 140px);
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-top: 0.5rem;
}

.biometric-iframe {
    width: 100%;
    height: 100%;
    min-height: 650px;
    border: none;
    display: block;
}

@media (max-width: 768px) {
    body.page-validate {
        padding: 0.25rem;
    }
    .container-validate {
        padding: 0.5rem;
    }
    .biometric-sdk-wrap {
        min-height: 540px;
        height: calc(100vh - 120px);
    }
}
