/* ===========================================================
   Auth Pages Styles
   Paleta: teal #17a2b8 (primario), naranja #fd7e14 (acento),
           #2c3e50 (texto oscuro), #666/#999 (texto secundario)
   =========================================================== */

.auth-container {
    min-height: calc(100vh - 400px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.auth-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    padding: 50px 40px;
}

/* El wizard de registro necesita algo más de aire para las filas de 2 columnas */
.auth-box--wizard {
    max-width: 560px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: #666;
    font-size: 15px;
}

/* ===========================================================
   Indicador de pasos
   =========================================================== */
.step-indicator {
    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin: 0 0 36px;
    padding: 0;
}

.step-indicator .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    width: 120px;
}

.step-dot {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #e5e5e5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #999;
    transition: all 0.3s ease;
}

.step-check {
    display: none;
    font-size: 16px;
}

.step-label {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-align: center;
    transition: color 0.3s ease;
}

.step-indicator .step.is-active .step-dot {
    border-color: #17a2b8;
    color: #17a2b8;
    box-shadow: 0 0 0 4px rgba(23, 162, 184, 0.12);
}

.step-indicator .step.is-active .step-label {
    color: #17a2b8;
}

.step-indicator .step.is-complete .step-dot {
    border-color: #17a2b8;
    background: #17a2b8;
    color: #fff;
}

.step-indicator .step.is-complete .step-number {
    display: none;
}

.step-indicator .step.is-complete .step-check {
    display: inline-block;
}

.step-indicator .step.is-complete .step-label {
    color: #2c3e50;
}

.step-track {
    flex: 1 1 auto;
    height: 2px;
    background: #e5e5e5;
    margin: 19px -6px 0;
    max-width: 90px;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.step-track-fill {
    position: absolute;
    inset: 0;
    background: #17a2b8;
    width: 0%;
    transition: width 0.35s ease;
}

/* ===========================================================
   Formulario y pasos
   =========================================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-step {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.form-step.is-active {
    display: flex;
    animation: fadeIn 0.35s ease;
}

.form-step-title {
    margin: 0 0 -6px;
    font-size: 17px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    padding: 14px 18px;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    color: #2c3e50;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
}

.form-group input:invalid[data-touched="true"],
.form-group.has-error input,
.form-group.has-error select {
    border-color: #dc3545;
}

/* ===========================================================
   Selector de rol
   =========================================================== */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.role-option {
    position: relative;
}

.role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.role-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 15px;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    height: 100%;
    box-sizing: border-box;
}

.role-label i {
    font-size: 36px;
    color: #17a2b8;
}

.role-label span {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.role-label small {
    font-size: 12.5px;
    color: #999;
    line-height: 1.4;
}

.role-option input[type="radio"]:checked + .role-label {
    border-color: #17a2b8;
    background: rgba(23, 162, 184, 0.05);
}

.role-option input[type="radio"]:checked + .role-label i {
    color: #fd7e14;
}

.role-option input[type="radio"]:focus-visible + .role-label {
    outline: 2px solid #17a2b8;
    outline-offset: 2px;
}

.role-fields {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.role-fields.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.password-toggle {
    position: relative;
}

.password-toggle input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.toggle-password:hover {
    color: #17a2b8;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex: 0 0 auto;
}

.forgot-password {
    color: #17a2b8;
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* ===========================================================
   Botones
   =========================================================== */
.btn-submit {
    padding: 16px;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.3);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-continue i {
    margin-left: 4px;
}

.step-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 6px;
}

.step-actions--single {
    justify-content: stretch;
}

.step-actions--single .btn-submit {
    width: 100%;
    margin-top: 0;
}

.step-actions .btn-submit {
    flex: 1 1 auto;
    margin-top: 0;
}

.btn-back {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back:hover {
    border-color: #17a2b8;
    color: #17a2b8;
}

.divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
    color: #999;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

.social-login {
    display: flex;
    gap: 15px;
}

.btn-social {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-social:hover {
    border-color: #17a2b8;
    background: rgba(23, 162, 184, 0.05);
}

.zoco-form-error {
    padding: 12px 14px;
    border: 1px solid rgba(220, 53, 69, 0.35);
    background: rgba(220, 53, 69, 0.08);
    border-radius: 10px;
    color: #b02a37;
    font-size: 14px;
}

.zoco-field-error {
    display: none;
    color: #dc3545;
    font-size: 0.85rem;
}

.zoco-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.zoco-modal.open {
    display: block;
}

.zoco-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.zoco-modal__dialog {
    position: relative;
    max-width: 520px;
    width: calc(100% - 32px);
    margin: 90px auto 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.zoco-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.zoco-modal__header h3 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.zoco-modal__close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #6c757d;
}

.zoco-modal__body {
    padding: 16px 18px;
    display: grid;
    gap: 10px;
    font-size: 15px;
    color: #2c3e50;
}

.zoco-modal__footer {
    padding: 14px 18px 18px;
    border-top: 1px solid #f0f0f0;
}

.btn-social i {
    font-size: 18px;
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e5e5e5;
    font-size: 14px;
    color: #666;
}

.auth-footer a {
    color: #17a2b8;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* ===========================================================
   Responsividad
   =========================================================== */
@media (max-width: 768px) {
    .auth-box {
        padding: 40px 25px;
    }

    .auth-box--wizard {
        padding: 32px 22px;
    }

    .auth-header h2 {
        font-size: 26px;
    }

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

    .role-selector {
        grid-template-columns: 1fr;
    }

    .step-indicator .step {
        width: 96px;
    }

    .step-label {
        font-size: 12px;
    }

    .social-login {
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .auth-container {
        padding: 32px 12px;
    }

    .auth-box--wizard {
        padding: 28px 16px;
        border-radius: 12px;
    }

    .step-dot {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .step-track {
        margin-top: 16px;
    }

    .step-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .step-actions .btn-back,
    .step-actions .btn-submit {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .form-step.is-active,
    .role-fields.active {
        animation: none;
    }

    .btn-submit:hover {
        transform: none;
    }
}
