/**
 * User Identification Form Styles
 *
 * Modern, responsive styling for the user identification form.
 */

.user-identification-form-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.user-identification-form {
    width: 100%;
}

.form-step {
    margin-bottom: 2rem;
}

.form-step h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #34495e;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.form-group input[type="password"] {
    letter-spacing: 2px;
}

.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
    font-weight: 500;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #229954;
    transform: translateY(-1px);
}

.user-info {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #3498db;
}

.user-info p {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: #2c3e50;
}

.user-info strong {
    color: #34495e;
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.form-message {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-weight: 500;
    display: none;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Disabled form state */
.form-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.form-disabled input,
.form-disabled button {
    cursor: not-allowed;
}

/* Countdown timer styles */
.countdown-timer {
    font-weight: bold;
    color: #dc3545;
}

/* Rate limit warning */
.rate-limit-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

/* Loading animation */
.btn:disabled {
    position: relative;
}

.btn:disabled::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .user-identification-form-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin-right: 0;
    }

    .form-step h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .user-identification-form-container {
        padding: 1rem;
    }

    .form-group input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* Accessibility improvements */
.form-group input:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .user-identification-form-container {
        border: 2px solid #000000;
    }

    .form-group input {
        border-width: 2px;
    }

    .user-info {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .form-group input {
        transition: none;
    }

    .btn:hover:not(:disabled) {
        transform: none;
    }
}

/* Improved styling for the Formulario Existente Encontrado card */
.duplicate-info-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-top: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border: none;
}

.duplicate-warning {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0 0 1rem 0;
    margin-bottom: 1.5rem;
    color: #e67e22;
    font-size: 1.1rem;
    font-weight: 600;
}

.duplicate-warning h4 {
    margin: 0 0 0.5rem 0;
    color: #e67e22;
    font-size: 1.1rem;
    font-weight: 700;
}

.duplicate-warning p {
    margin: 0;
    color: #444;
    font-size: 1rem;
    font-weight: 400;
}

.data-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.existing-data,
.new-data {
    background: #f8f9fa;
    padding: 18px 16px 16px 16px;
    border-radius: 8px;
    border-left: 5px solid #ffe066;
    box-shadow: 0 1px 4px rgba(52, 152, 219, 0.04);
}

.existing-data h5,
.new-data h5 {
    margin: 0 0 10px 0;
    color: #23282d;
    font-size: 1.08rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

/* Remove icons from headings */
.existing-data h5::before,
.new-data h5::before {
    content: none !important;
    display: none !important;
}

.existing-data ul,
.new-data ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.existing-data li,
.new-data li {
    margin: 8px 0;
    font-size: 1rem;
    line-height: 1.5;
}

.clave-update-group label {
    font-weight: 600;
    color: #b8860b;
    margin-bottom: 0.3em;
    display: block;
}

.clave-update-group input[type="text"] {
    border: 2px solid #ffe066;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 1rem;
    background: #fff;
    margin-top: 0.2em;
    margin-bottom: 0.2em;
    width: 100%;
    box-sizing: border-box;
}

.clave-update-group input[type="text"]:focus {
    border-color: #ffae42;
    outline: none;
    box-shadow: 0 0 0 2px #ffe06644;
}

.duplicate-actions {
    background: #f8f9fa;
    padding: 18px 0 10px 0;
    border-radius: 8px;
    text-align: center;
    margin-top: 10px;
}

.duplicate-actions p {
    margin: 0 0 15px 0;
    font-weight: 600;
    color: #23282d;
    font-size: 1.08rem;
}

.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* Remove .action-buttons .button custom styles so .btn styles apply */
.action-buttons .button {
    all: unset;
}
.action-buttons .btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}
.action-buttons .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }
    .action-buttons .btn {
        width: 100%;
        margin-right: 0;
    }
}

/* Ensure .btn.btn-secondary matches other secondary buttons */
.btn.btn-secondary {
    background-color: #95a5a6;
    color: white;
}
.btn.btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
    color: white;
    transform: translateY(-1px);
}