/* ========================
   Auth shared styles
=========================== */

.auth-page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background: var(--accent-gradient);
    overflow: hidden;
    padding: 4rem 1.5rem;
    min-height: 70vh;
}

.auth-page-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.6;
    pointer-events: none;
}

.auth-entrance {
    position: relative;
    z-index: 10;
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
    width: 100%;
    display: flex;
    justify-content: center;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-glass-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 50;
}

.auth-glass-card--sm {
    max-width: 450px;
}

.auth-glass-card--md {
    max-width: 550px;
}

.auth-glass-card--lg {
    max-width: 800px;
    padding: 2.5rem;
}

.auth-glass-card--center {
    text-align: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-align: center;
}

.auth-title--lg {
    font-size: 2rem;
}

.auth-subtitle {
    color: #64748b;
    font-size: 1rem;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.form-label-custom {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: block;
}

.form-control-custom {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    transition: all 0.2s;
    width: 100%;
    color: #1e293b;
}

.form-control-custom:focus {
    background: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(26, 137, 188, 0.15);
    outline: none;
}

.auth-input-group .form-control-custom {
    border-radius: 12px 0 0 12px;
    flex: 1 1 auto;
    width: 1%;
}

.auth-input-group .auth-input-addon {
    border-color: #e2e8f0;
    border-radius: 0 12px 12px 0;
    background: #f8fafc;
    color: #64748b;
}

.btn-auth-primary {
    background: var(--accent-gradient);
    border: none;
    color: #ffffff;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    width: 100%;
    font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

.btn-auth-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(22, 189, 156, 0.3);
    color: #ffffff;
}

.btn-auth-ghost {
    background: transparent;
    border: 2px solid #cbd5e1;
    color: #64748b;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    width: 100%;
    margin-top: 1rem;
    transition: all 0.2s;
}

.btn-auth-ghost:hover {
    border-color: #94a3b8;
    color: #475569;
    background: #f8fafc;
}

.auth-footer-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
    color: #64748b;
}

.auth-footer-links a {
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: none;
}

.auth-links {
    margin-top: 0;
    text-align: left;
}

.auth-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.auth-link-accent {
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: none;
}

.auth-link-accent:hover {
    color: #0c4a6e;
}

.auth-email-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: rgba(26, 137, 188, 0.1);
    color: var(--accent-color);
    font-weight: 700;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-timer {
    color: #475569;
    font-weight: 600;
}

.auth-resend-timer {
    display: none;
}

.auth-icon {
    font-size: 3.5rem;
}

.auth-icon--md {
    font-size: 3rem;
}

.auth-icon--accent {
    color: var(--accent-color);
}

.auth-section-title {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    margin-top: 1rem;
}

.auth-radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    background: #ffffff;
    transition: all 0.2s;
}

.auth-radio-input {
    display: none;
}

.auth-radio-input:checked+.auth-radio-label {
    border-color: var(--accent-color);
    background: rgba(26, 137, 188, 0.05);
    color: var(--accent-color);
}

.expandable-container {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-out;
    overflow: hidden;
}

.expandable-container.open {
    grid-template-rows: 1fr;
    margin-bottom: 1rem;
}

.expandable-content {
    min-height: 0;
}

.auth-instrument-container {
    transition: opacity 0.3s ease;
}

#email-error-msg {
    display: none;
    color: #ef4444;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

#email-recovery-link {
    display: none;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem;
    background: #fef2f2;
    border: 1px dashed #ef4444;
    border-radius: 8px;
    text-align: center;
}

.auth-fade-in {
    animation: authFadeIn 0.4s ease-in forwards;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-recaptcha {
    width: 100%;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-recaptcha__widget {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: hidden;
    max-width: 100%;
    min-width: 0;
}

.auth-recaptcha__widget .g-recaptcha {
    display: inline-block;
    transform-origin: center top;
    -webkit-transform-origin: center top;
}

.auth-recaptcha__error {
    text-align: center;
    margin-top: 0.5rem;
    max-width: 100%;
    word-break: break-word;
}

.input-group-text {
    padding-left: 1rem;
}

.input-group-text i {
    font-size: 1.1rem;
}

.form-control-custom.ps-5 {
    padding-left: 3rem !important;
}

.auth-viewport {
    position: relative;
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    background: var(--accent-gradient);
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

.auth-shell {
    position: relative;
    width: 100%;
    z-index: 2;
    margin: 0 auto;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.auth-card__form {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-card__header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-form .form-label {
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.auth-control {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 0.8rem 1rem;
    background: #fff;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    width: 100%;
    color: #1e293b;
}

.auth-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(26, 137, 188, 0.1);
    outline: none;
}

.auth-button {
    border: none;
    border-radius: 50px;
    padding: 0.9rem 2rem;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    background: var(--accent-gradient);
    box-shadow: 0 10px 25px -5px rgba(26, 137, 188, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px -5px rgba(26, 137, 188, 0.5);
    filter: brightness(1.05);
    color: #fff;
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-button--ghost {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid rgba(26, 137, 188, 0.25);
    box-shadow: none;
}

.auth-button--ghost:hover {
    color: #0c4a6e;
    border-color: rgba(26, 137, 188, 0.45);
    box-shadow: none;
}

.auth-aux {
    text-align: center;
    margin-top: 1.5rem;
    color: #64748b;
    font-size: 0.95rem;
}

.auth-aux a {
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-aux a:hover {
    color: #0c4a6e;
    text-decoration: underline;
}

.auth-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.auth-check input {
    width: 1.1em;
    height: 1.1em;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.auth-captcha {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.button-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.auth-button.is-loading .button-spinner {
    display: block;
}

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

.login-loading {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    display: none;
    margin-bottom: 0.5rem;
}

.login-loading.active {
    display: block;
}

@media (max-width: 768px) {
    .auth-title {
        font-size: 1.75rem;
    }

    .auth-viewport {
        padding: 2rem 1rem;
        align-items: flex-start;
    }

    .auth-card__form {
        padding: 1.5rem 1.25rem;
    }
}