/* ===== PAGE BANNER ===== */
.page-banner {
    position: relative;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 80px;
    overflow: hidden;
}

.banner-bg {
    position: absolute;
    inset: 0;
}

.banner-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(2, 132, 119, 0.92) 0%, rgba(1, 78, 69, 0.95) 100%);
}

.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    max-width: 700px;
    padding: 0 30px;
}

.banner-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4.5vw, 2.8rem);
    font-weight: 800;
    margin-bottom: clamp(8px, 1.5vw, 15px);
}

.banner-subtitle {
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    opacity: 0.9;
    line-height: 1.7;
    margin-bottom: clamp(10px, 2vw, 20px);
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    opacity: 0.8;
}

.breadcrumb a {
    color: var(--white);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ===== CONTAINER ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ===== REGISTRATION SECTION ===== */
.registration-section {
    padding: clamp(40px, 8vw, 80px) 0 clamp(50px, 10vw, 100px);
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}

.registration-wrapper {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 0;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12);
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

/* ===== LEFT SIDE - INFO ===== */
.registration-info {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
    padding: clamp(24px, 5vw, 50px) clamp(20px, 4vw, 35px);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.registration-info::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 195, 74, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.info-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: clamp(6px, 1.2vw, 10px) clamp(12px, 2vw, 20px);
    border-radius: var(--radius-full);
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    font-weight: 600;
    margin-bottom: clamp(15px, 3vw, 25px);
    color: rgba(255, 255, 255, 0.95);
}

.info-content h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 3.5vw, 2.2rem);
    font-weight: 800;
    margin-bottom: clamp(6px, 1.2vw, 10px);
    color: #fff;
}

.info-subtitle {
    font-size: clamp(0.85rem, 1.6vw, 1.1rem);
    margin-bottom: clamp(20px, 4vw, 35px);
    color: rgba(255, 255, 255, 0.90) !important;
}

.info-features {
    margin-bottom: clamp(24px, 5vw, 40px);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.3vw, 12px);
    margin-bottom: clamp(10px, 1.8vw, 15px);
    font-size: clamp(0.85rem, 1.3vw, 1rem);
    color: rgba(255, 255, 255, 0.9);
}

.feature-item i {
    color: var(--accent);
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
}

.info-contact,
.info-hours {
    padding: clamp(14px, 2.5vw, 20px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    margin-bottom: clamp(10px, 1.8vw, 15px);
}

.info-contact p,
.info-hours p {
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    opacity: 0.8;
    margin-bottom: clamp(4px, 0.8vw, 8px);
    color: rgba(255, 255, 255, 0.9);
}

.info-contact a {
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
}

.info-hours span {
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

/* ===== RIGHT SIDE - FORM ===== */
.registration-form-wrapper {
    padding: clamp(24px, 5vw, 50px) clamp(20px, 4vw, 40px);
}

/* ===== PROGRESS STEPS ===== */
.form-progress {
    display: flex;
    justify-content: center;
    gap: clamp(16px, 3vw, 30px);
    margin-bottom: clamp(24px, 5vw, 40px);
    padding-bottom: clamp(16px, 3vw, 30px);
    border-bottom: 1px solid var(--gray-200);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.2vw, 10px);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.completed {
    opacity: 1;
}

.step-number {
    width: clamp(36px, 5vw, 42px);
    height: clamp(36px, 5vw, 42px);
    background: var(--gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(0.85rem, 1.3vw, 1rem);
    color: var(--text-muted);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.progress-step.active .step-number {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.4);
}

.progress-step.completed .step-number {
    background: var(--primary);
    color: var(--white);
}

.progress-step span {
    font-weight: 700;
    font-size: clamp(0.85rem, 1.4vw, 1.05rem);
    color: var(--text);
}

/* ===== FORM STEPS ===== */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.form-step-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-100);
}

.form-step-title i {
    color: var(--primary);
}

/* ===== FORM GRID ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1fr;
    gap: 20px;
}

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

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: clamp(0.8rem, 1.3vw, 0.9rem);
    color: var(--text);
    margin-bottom: clamp(5px, 1vw, 8px);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: clamp(10px, 1.6vw, 14px) clamp(12px, 1.8vw, 16px);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: clamp(0.88rem, 1.3vw, 1rem);
    font-family: var(--font-primary);
    color: var(--text);
    background: var(--white);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select:disabled,
.form-group input:disabled {
    background: var(--gray-100, #f5f5f5);
    border-color: var(--gray-200);
    color: var(--text-muted, #999);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===== FILE UPLOAD ===== */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.file-label i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.file-label span {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.file-label small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.file-name {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

/* ===== TERMS ===== */
.form-terms {
    margin: 25px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 12px;
}

.checkbox-label:last-child {
    margin-bottom: 0;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.checkbox-label span:last-child {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ===== FINALIZAR SECTIONS ===== */
.finalizar-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--gray-200);
}

.finalizar-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.section-subtitle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.section-subtitle i {
    font-size: 1rem;
}

.section-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.section-desc strong {
    color: var(--primary);
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: clamp(20px, 4vw, 30px);
    padding-top: clamp(16px, 3vw, 25px);
    border-top: 1px solid var(--gray-100);
}

.btn-next,
.btn-back,
.btn-submit {
    min-width: clamp(140px, 25vw, 180px);
}

/* ===== DOCUMENTS INFO ===== */
.documents-info {
    background: rgba(var(--primary-rgb), 0.1);
    padding: clamp(10px, 1.8vw, 15px) clamp(14px, 2.2vw, 20px);
    border-radius: var(--radius-md);
    margin-bottom: clamp(16px, 3vw, 25px);
}

.documents-info p {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vw, 10px);
    color: var(--primary-dark);
    font-size: clamp(0.82rem, 1.2vw, 0.95rem);
}

.documents-info i {
    font-size: 1.2rem;
}

/* ===== SUCCESS MESSAGE ===== */
.success-message {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.success-message.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    box-shadow: 0 10px 40px rgba(var(--primary-rgb), 0.4);
}

.success-icon i {
    font-size: 3rem;
    color: var(--white);
}

.success-message h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 15px;
}

.success-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.success-code {
    background: var(--gray-50);
    padding: 15px 25px;
    border-radius: var(--radius-md);
    display: inline-block;
    margin: 20px 0 30px;
    font-size: 1rem;
}

.success-code strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ===== RADIO GROUP ===== */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 150px;
    background-color: var(--white);
}

.radio-label:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary);
    background: var(--primary);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
}

.radio-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text);
    transition: all 0.3s ease;
}

/* ===== INPUT WITH BADGE ===== */
.input-with-badge {
    position: relative;
}

.input-with-badge input {
    padding-right: 70px;
}

.input-badge {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    pointer-events: none;
}

/* ===== PASSWORD INPUT ===== */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary);
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 8px;
    display: none;
}

.password-strength.show {
    display: block;
}

.strength-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.strength-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.password-strength.weak .strength-bar::after {
    width: 33%;
    background: #e74c3c;
}

.password-strength.medium .strength-bar::after {
    width: 66%;
    background: #f39c12;
}

.password-strength.strong .strength-bar::after {
    width: 100%;
    background: #27ae60;
}

.strength-text {
    font-size: 0.8rem;
    font-weight: 600;
}

.password-strength.weak .strength-text { color: #e74c3c; }
.password-strength.medium .strength-text { color: #f39c12; }
.password-strength.strong .strength-text { color: #27ae60; }

/* ===== PASSWORD MATCH ===== */
.password-match {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 5px;
}

.password-match.match { color: #27ae60; }
.password-match.no-match { color: #e74c3c; }

/* ===== FORM HINT ===== */
.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ===== NIF INPUT ===== */
.nif-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.nif-input-wrapper input,
.nif-input-wrapper select {
    flex: 1;
    padding-right: 50px;
}

.btn-nif-lookup {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.btn-nif-lookup:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.05);
}

.btn-nif-lookup:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: translateY(-50%);
}

/* ===== NIF STATUS ===== */
.nif-status {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 5px;
    min-height: 20px;
}

.nif-status i { margin-right: 5px; }

.nif-status-loading { color: #f39c12; }
.nif-status-success { color: #27ae60; }
.nif-status-error { color: #e74c3c; }
.nif-status-warning { color: #e67e22; }

/* ===== NIF DATA BOX ===== */
.nif-data-box {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.08) 0%, rgba(39, 174, 96, 0.02) 100%);
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px;
    animation: fadeIn 0.4s ease;
}

.nif-data-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #27ae60;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(39, 174, 96, 0.2);
}

.nif-data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.nif-data-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nif-data-item label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.nif-data-item span {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}

/* ===== PAYMENT SUMMARY ===== */
.payment-summary {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid var(--gray-200);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.95rem;
}

.summary-row span { color: var(--text-secondary); }
.summary-row strong { color: var(--text); font-weight: 600; }

.summary-row.total {
    border-top: 2px solid var(--gray-200);
    margin-top: 10px;
    padding-top: 15px;
}

.summary-row.total strong {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 800;
}

/* ===== PAYMENT METHODS ===== */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.payment-method { cursor: pointer; }

.payment-method input[type="radio"] { display: none; }

.payment-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 25px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    text-align: center;
}

.payment-card i {
    font-size: 2rem;
    color: var(--primary);
}

.payment-card span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.payment-method:hover .payment-card {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.payment-method input[type="radio"]:checked + .payment-card {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--accent-rgb), 0.05) 100%);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.2);
}

/* ===== BANK INFO ===== */
.bank-info {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 25px;
    border: 1px solid var(--gray-200);
}

.bank-info h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.bank-detail {
    padding: 8px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-bottom: 1px dashed var(--gray-200);
}

.bank-detail:last-child { border-bottom: none; }

.bank-detail strong {
    color: var(--text);
    font-weight: 600;
    margin-right: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .registration-wrapper {
        grid-template-columns: 1fr;
    }
    .registration-info { padding: clamp(24px, 4vw, 40px) clamp(20px, 3vw, 30px); }
    .registration-form-wrapper { padding: clamp(24px, 4vw, 40px) clamp(20px, 3vw, 30px); }
}

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full-width { grid-column: span 1; }
    .form-grid-3 { grid-template-columns: 1fr; }
    .form-progress { flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
    .progress-step span { display: none; }
    .progress-step { gap: 0; }
    .form-actions { flex-direction: column-reverse; gap: 15px; }
    .btn-next, .btn-back, .btn-submit { width: 100%; justify-content: center; }
    .payment-methods { grid-template-columns: 1fr; }
    .success-actions { flex-direction: column; }
    .success-actions .btn { width: 100%; justify-content: center; }
    .nif-data-grid { grid-template-columns: 1fr; }
    .payment-summary { max-height: none; }
}

/* ===== FIELD VALIDATION ERRORS ===== */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    background-color: #fef2f2;
}

.form-group.has-error .file-label {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

.form-group.has-error .payment-methods {
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 8px;
    background-color: #fef2f2;
}

.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
    animation: errorSlideIn 0.3s ease;
}

.field-error i {
    font-size: 0.75rem;
    flex-shrink: 0;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success state for corrected fields */
.form-group:not(.has-error) input:valid:not(:placeholder-shown),
.form-group:not(.has-error) select:valid:not([value=""]) {
    border-color: var(--primary);
}

/* ===== FLUID INSCRICAO OVERRIDES ===== */
@media (max-width: 1024px) {
    .page-banner { height: clamp(200px, 40vw, 350px); margin-top: clamp(60px, 10vw, 80px); }
    .banner-content { padding: 0 clamp(16px, 3vw, 30px); }
    .banner-title { font-size: clamp(1.4rem, 4vw, 2.8rem); margin-bottom: clamp(8px, 1.5vw, 15px); }
    .banner-subtitle { font-size: clamp(0.85rem, 1.8vw, 1.1rem); margin-bottom: clamp(10px, 2vw, 20px); }
    .breadcrumb { font-size: clamp(0.75rem, 1.2vw, 0.9rem); }
    .registration-wrapper { gap: clamp(16px, 3vw, 30px); }
    .registration-info { padding: clamp(20px, 4vw, 40px) clamp(16px, 3vw, 30px); }
    .registration-form-wrapper { padding: clamp(20px, 4vw, 40px) clamp(16px, 3vw, 30px); }
    .info-content h2 { font-size: clamp(1.2rem, 3vw, 2.2rem); margin-bottom: clamp(10px, 2vw, 20px); }
    .info-content p { font-size: clamp(0.82rem, 1.3vw, 1rem); }
    .info-features li { font-size: clamp(0.78rem, 1.2vw, 0.92rem); padding: clamp(4px, 0.8vw, 8px) 0; }
    .info-features li i { font-size: clamp(0.7rem, 1vw, 0.85rem); }
    .form-progress { padding: clamp(10px, 2vw, 16px); gap: clamp(6px, 1.2vw, 10px); }
    .progress-step { padding: clamp(6px, 1.2vw, 10px) clamp(8px, 1.5vw, 14px); font-size: clamp(0.7rem, 1.1vw, 0.85rem); }
    .progress-step span { font-size: clamp(0.65rem, 1vw, 0.82rem); }
    .form-group label { font-size: clamp(0.75rem, 1.2vw, 0.9rem); margin-bottom: clamp(4px, 0.8vw, 8px); }
    .form-group input, .form-group select, .form-group textarea {
        padding: clamp(8px, 1.3vw, 12px) clamp(10px, 1.5vw, 14px);
        font-size: clamp(0.85rem, 1.3vw, 1rem);
    }
    .form-grid { gap: clamp(10px, 1.5vw, 16px); }
    .form-actions { gap: clamp(10px, 1.5vw, 16px); }
    .btn-next, .btn-back, .btn-submit { padding: clamp(10px, 1.5vw, 14px) clamp(16px, 2.5vw, 24px); font-size: clamp(0.82rem, 1.2vw, 0.95rem); }
    .payment-methods { gap: clamp(8px, 1.2vw, 12px); }
    .payment-method { padding: clamp(10px, 1.5vw, 14px); font-size: clamp(0.78rem, 1.1vw, 0.88rem); }
    .payment-method .method-name { font-size: clamp(0.78rem, 1.1vw, 0.9rem); }
    .payment-method .method-desc { font-size: clamp(0.68rem, 1vw, 0.78rem); }
    .payment-summary { padding: clamp(12px, 2vw, 20px); }
    .payment-summary h3 { font-size: clamp(0.9rem, 1.5vw, 1.1rem); }
    .summary-row { font-size: clamp(0.78rem, 1.2vw, 0.9rem); }
    .summary-row.total { font-size: clamp(0.85rem, 1.3vw, 1rem); }
    .success-card { padding: clamp(20px, 4vw, 40px) clamp(16px, 3vw, 30px); }
    .success-icon { width: clamp(50px, 8vw, 80px); height: clamp(50px, 8vw, 80px); font-size: clamp(1.3rem, 2.5vw, 2.5rem); }
    .success-card h2 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }
    .success-card p { font-size: clamp(0.82rem, 1.3vw, 1rem); }
    .success-actions { gap: clamp(8px, 1.2vw, 12px); }
    .success-actions .btn { padding: clamp(10px, 1.5vw, 14px) clamp(16px, 2.5vw, 24px); font-size: clamp(0.82rem, 1.2vw, 0.95rem); }
    .nif-data-grid { gap: clamp(8px, 1.2vw, 12px); }
    .file-upload-area { padding: clamp(16px, 3vw, 24px); border-width: 2px; }
    .file-upload-area i { font-size: clamp(1.3rem, 2vw, 2rem); margin-bottom: clamp(6px, 1vw, 10px); }
    .file-upload-area p { font-size: clamp(0.78rem, 1.1vw, 0.9rem); }
    .file-upload-area .file-types { font-size: clamp(0.68rem, 1vw, 0.78rem); }
    .file-preview { padding: clamp(8px, 1.2vw, 12px); }
    .file-preview .file-name { font-size: clamp(0.75rem, 1.1vw, 0.85rem); }
    .info-card { padding: clamp(12px, 2vw, 20px); gap: clamp(8px, 1.2vw, 12px); }
    .info-card i { font-size: clamp(1rem, 1.8vw, 1.5rem); }
    .info-card h3 { font-size: clamp(0.88rem, 1.4vw, 1.1rem); margin-bottom: clamp(4px, 0.8vw, 8px); }
    .info-card p { font-size: clamp(0.75rem, 1.1vw, 0.88rem); }
    .required-note { font-size: clamp(0.68rem, 1vw, 0.78rem); }
    .form-section-title { font-size: clamp(0.88rem, 1.4vw, 1.1rem); margin-bottom: clamp(8px, 1.2vw, 16px); padding-bottom: clamp(6px, 1vw, 10px); }
    .form-section-title i { font-size: clamp(0.85rem, 1.3vw, 1rem); }
}

/* ======================================================================
   MOBILE-FIRST RESPONSIVE OVERRIDES
   Base = mobile | min-width: 768px = tablet | min-width: 1024px = desktop
   ====================================================================== */

/* ---------- BASE: MOBILE (single column, compact spacing) ---------- */
.page-banner {
    height: clamp(180px, 30vw, 350px);
    margin-top: clamp(60px, 10vw, 80px);
}

.registration-wrapper {
    grid-template-columns: 1fr;
    margin-top: -30px;
    border-radius: var(--radius-lg);
}

.form-progress {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding-bottom: 12px;
}

.progress-step {
    gap: 4px;
}

.progress-step span {
    display: none;
}

.step-number {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
}

.form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
}

.form-grid-3 {
    grid-template-columns: 1fr;
}

.form-group.full-width {
    grid-column: span 1;
}

.form-group input,
.form-group select,
.form-group textarea {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
}

.form-actions {
    flex-direction: column-reverse;
    gap: 12px;
}

.btn-next,
.btn-back,
.btn-submit {
    width: 100%;
    min-height: 48px;
    min-width: 0;
    justify-content: center;
    padding: 12px 20px;
    font-size: 1rem;
}

.payment-methods {
    grid-template-columns: 1fr;
    gap: 12px;
}

.payment-card {
    padding: 20px 16px;
    min-height: 48px;
}

.nif-data-grid {
    grid-template-columns: 1fr;
}

.file-label {
    padding: 24px 16px;
    min-height: 48px;
}

.file-label i {
    font-size: 2rem;
}

.radio-label {
    min-width: 0;
    padding: 14px 16px;
}

.checkbox-label input {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
}

.toggle-password {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-nif-lookup {
    width: 44px;
    height: 44px;
}

/* ---------- TABLET (min-width: 768px) ---------- */
@media (min-width: 768px) {
    .page-banner {
        height: clamp(240px, 30vw, 350px);
        margin-top: clamp(60px, 8vw, 80px);
    }

    .registration-wrapper {
        margin-top: -50px;
        border-radius: var(--radius-xl);
    }

    .form-progress {
        flex-wrap: nowrap;
        gap: 16px;
        justify-content: center;
    }

    .progress-step {
        gap: 6px;
    }

    .progress-step span {
        display: inline;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .form-grid-3 {
        grid-template-columns: 1.5fr 1.5fr 1fr;
    }

    .form-group.full-width {
        grid-column: span 2;
    }

    .form-actions {
        flex-direction: row;
        gap: 16px;
    }

    .btn-next,
    .btn-back,
    .btn-submit {
        width: auto;
        min-height: 48px;
    }

    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
    }

    .nif-data-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .radio-label {
        min-width: 150px;
    }
}

/* ---------- DESKTOP (min-width: 1024px) — 2-column layout ---------- */
@media (min-width: 1024px) {
    .page-banner {
        height: 350px;
        margin-top: 80px;
    }

    .registration-wrapper {
        grid-template-columns: 400px 1fr;
        margin-top: -60px;
    }

    .form-progress {
        gap: clamp(16px, 3vw, 30px);
    }

    .form-grid {
        gap: 20px;
    }

    .payment-methods {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: auto;
    }

    .btn-next,
    .btn-back,
    .btn-submit {
        min-width: clamp(140px, 25vw, 180px);
    }
}

/* ===== UPLOAD PROGRESS BAR ===== */
.upload-progress {
    background: linear-gradient(135deg, rgba(61, 122, 61, 0.06) 0%, rgba(139, 195, 74, 0.04) 100%);
    border: 1px solid rgba(61, 122, 61, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e8f5e9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3d7a3d, #8bc34a);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3d7a3d;
}

/* ===== UPLOAD STATUS (Step-by-step) ===== */
.upload-status {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    display: none;
}
.upload-status i { margin-right: 5px; }
.upload-loading {
    display: block;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
}
.upload-success {
    display: block;
    color: #155724;
    background: #d4edda;
    border: 1px solid #28a745;
}
.upload-error {
    display: block;
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #dc3545;
}
