body {
    font-family: Arial, sans-serif;
    background-color: #d9efed;
    min-height: 100vh;
    margin: 0;
    height: 100%;
}

.card {
    background: white;
    padding: 0.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 0 auto;
    max-width: 700px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.step {
    display: flex;
    align-items: center;
    margin: 0 20px;
    color: #999;
}

.step.active {
    color: #007bff;
    font-weight: bold;
}

.step.completed {
    color: #28a745;
}

.step-number {
    background: #ddd;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.step.active .step-number {
    background: #007bff;
}

.step.completed .step-number {
    background: #28a745;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input, .form-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
}

.data-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    margin-bottom: 25px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    font-weight: bold;
    color: #333;
}

.data-value {
    color: #666;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 5px;
    text-decoration: none;
}

.btn-primary {
    background: #3FB498;
    color: white;
}

.btn-primary:hover {
    background: #3A8472;
}

.btn-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.hidden {
    display: none;
}

.errorlist {
    color: #dc3545;
    list-style: none;
    padding: 0;
    margin: 5px 0;
}

.errorlist li {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 5px;
}

/* Error display for photo validation errors */
.error-display {
    margin-bottom: 20px;
}

.error-display .errorlist {
    margin: 0;
}

.error-display .errorlist li {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    font-weight: bold;
}

/* Header second line - normal font and closer spacing */
.header-second-line {
    font-weight: normal;
    margin-top: -10px;
    margin-bottom: 15px;
}

/* DocuPass section with reference styles */
.with-reference {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 2px solid #1976d2;
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(25, 118, 210, 0.15);
}

.with-reference h3 {
    color: #1976d2;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4em;
    font-weight: 600;
}

.reference-data {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    margin-bottom: 25px;
}

.reference-data .field-dni {
    grid-column: 1;
}

.reference-data .field-tramite {
    grid-column: 2;
}

.reference-data .field-sexo {
    grid-column: 3;
    min-width: 120px;
}

.reference-field {
    background: white;
    border-radius: 8px;
    padding: 12px 15px;
    border-left: 4px solid #1976d2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.reference-field-label {
    font-weight: bold;
    color: #1976d2;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.reference-field-value {
    color: #333;
    font-size: 1.1em;
}

.reference-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.reference-images .picture-left {
    grid-row: 1 / 3;
}

.reference-images .ids-right {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
}

.reference-image {
    text-align: center;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.reference-image img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    margin-bottom: 8px;
}

.reference-image-label {
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
}

.continue-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 20px auto 0;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.continue-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.continue-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Image popup styles */
.image-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.image-popup-container {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Make ID card images clickable */
.id-card-image {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.id-card-image:hover {
    transform: scale(1.05);
}

/* Validation result pages */
.validation-success-container,
.validation-failed-container,
.registration-error-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Form cover image centering styles */
.form-page-cover-image-align-center {
    text-align: center;
}

.form-page-cover-image-wrapper {
    margin: 0 auto;
    display: inline-block;
}

.form-page-cover-image {
    display: block;
    margin: 0 auto;
}

/* Docupass section centering */
.docupass-section {
    text-align: center;
}

.header-margin {
    margin-top: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
}

.main-margin {
    margin-left: 1rem;
    margin-right: 1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .step-indicator {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .step {
        margin: 0;
        justify-content: center;
    }

    /* Stack reference data fields vertically on mobile */
    .reference-data {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 10px;
    }

    .reference-data .field-dni {
        grid-column: 1;
        grid-row: 1;
    }

    .reference-data .field-tramite {
        grid-column: 1;
        grid-row: 2;
    }

    .reference-data .field-sexo {
        grid-column: 1;
        grid-row: 3;
        min-width: auto;
    }

    /* Stack reference images vertically on mobile */
    .reference-images {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 15px;
    }

    .reference-images .picture-left {
        grid-row: 1;
    }

    .reference-images .ids-right {
        grid-template-rows: auto auto;
        gap: 15px;
        grid-row: 2 / 4;
    }

    /* Adjust image sizes for mobile */
    .reference-image img {
        max-width: 250px;
    }

    .validation-success-container,
    .validation-failed-container,
    .registration-error-container {
        padding: 20px 10px;
    }

    .header-margin {
        margin-top: 4px;
        margin-left: 4px;
        margin-right: 4px;
    }

    .main-margin {
        margin-left: 4px;
        margin-right: 4px;
    }
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 20px;
    /* font-weight: bold; */
}

footer {
    background: #2E384B;
    color: whitesmoke;
    margin-top: auto;
    padding: 0 2rem;
}

footer a {
    color: #ffffff;
}

.page-grid {
  display: grid;
  grid-template-rows: auto 1fr auto; /* Header, content (expands), footer */
  min-height: 100vh;
}
