/* ═══════════════════════════════════════════════════════════════════════════
   TEDUCAS Auth Modal — Tailwind-inspired design tokens
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset del modal ─ */
.teducas-auth,
.teducas-auth *,
.teducas-auth *::before,
.teducas-auth *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.teducas-auth {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: var(--e-global-typography-text-font-family, "Inter"), sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.teducas-auth.teducas-auth--open,
.teducas-auth.teducas-auth--active {
    display: flex;
}

/* ── Backdrop ─ */
.teducas-auth__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ── Container ─ */
.teducas-auth__container {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 32px 28px 28px;
    animation: teducasSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Close button ─ */
#teducas-auth-modal .teducas-auth__close {
    position: absolute !important;
    top: 12px !important;
    right: 14px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 22px !important;
    line-height: 1 !important;
    color: #A1A1AA !important;
    cursor: pointer !important;
    transition: background-color 0.15s, color 0.15s !important;
    box-shadow: none !important;
    padding: 0 !important;
}
#teducas-auth-modal .teducas-auth__close:hover {
    background-color: #F4F4F5 !important;
    color: var(--e-global-color-text, #27272A) !important;
}

/* ── Header ─ */
.teducas-auth__header {
    text-align: center;
    margin-bottom: 24px;
}
.teducas-auth__logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    display: block;
    border: 3px solid #F4F4F5;
}
.teducas-auth__title {
    font-family: var(--e-global-typography-primary-font-family, "Inter"), sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--e-global-color-text, #27272A);
    letter-spacing: -0.025em;
    margin: 0 0 4px;
}
.teducas-auth__subtitle {
    font-size: 14px;
    color: #71717A;
    margin: 0;
}

/* ── Tabs ─ */
#teducas-auth-modal .teducas-auth__tabs {
    display: flex;
    position: relative;
    border-bottom: 1px solid #E4E4E7;
    margin-bottom: 24px;
}
#teducas-auth-modal .teducas-auth__tab {
    flex: 1;
    padding: 10px 0;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: var(--e-global-typography-primary-font-family, "Inter"), sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #A1A1AA !important;
    cursor: pointer;
    transition: color 0.2s;
    box-shadow: none !important;
}
#teducas-auth-modal .teducas-auth__tab:hover {
    color: #71717A !important;
    background: transparent !important;
}
#teducas-auth-modal .teducas-auth__tab.teducas-auth__tab--active,
#teducas-auth-modal .teducas-auth__tab--active {
    color: var(--e-global-color-primary, #FACC15) !important;
    background: transparent !important;
    font-weight: 600 !important;
}
#teducas-auth-modal .teducas-auth__tab-indicator {
    position: absolute;
    bottom: -1px;
    height: 2px;
    background: var(--e-global-color-primary, #FACC15);
    border-radius: 2px;
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Panels ─ */
.teducas-auth__panel {
    display: none;
}
.teducas-auth__panel.teducas-auth__panel--active,
.teducas-auth__panel--active {
    display: block;
}

/* ── Fields ─ */
.teducas-auth__field {
    margin-bottom: 16px;
}
.teducas-auth__field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--e-global-color-text, #27272A);
    margin-bottom: 6px;
}
.teducas-auth__field input[type="text"],
.teducas-auth__field input[type="email"],
.teducas-auth__field input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: #FFFFFF;
    border: 1px solid #E4E4E7;
    border-radius: 8px;
    font-family: var(--e-global-typography-text-font-family, "Inter"), sans-serif;
    font-size: 15px;
    color: var(--e-global-color-text, #27272A);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.teducas-auth__field input:focus {
    border-color: var(--e-global-color-primary, #FACC15);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--e-global-color-primary, #FACC15) 10%, transparent);
}
.teducas-auth__field input::placeholder {
    color: #A1A1AA;
}

/* ── Password wrapper ─ */
.teducas-auth__pass-wrap {
    position: relative;
}
.teducas-auth__pass-wrap input {
    padding-right: 44px !important;
}
.teducas-auth__toggle-pass {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #A1A1AA;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
}
.teducas-auth__toggle-pass:hover {
    background-color: #F4F4F5;
    color: #71717A;
}
.teducas-auth__toggle-pass.teducas-auth__toggle-pass--visible,
.teducas-auth__toggle-pass--visible {
    color: var(--e-global-color-primary, #FACC15);
}

/* ── Password strength ─ */
.teducas-auth__strength {
    font-size: var(--e-global-typography-secondary-font-size, 12px);
    font-weight: 500;
    margin-top: 4px;
    min-height: 16px;
    line-height: 16px;
}

/* ── Row: remember + forgot ─ */
.teducas-auth__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.teducas-auth__check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--e-global-color-text, #27272A);
    cursor: pointer;
    user-select: none;
}
.teducas-auth__check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--e-global-color-primary, #FACC15);
    border-radius: 4px;
}

/* ── Links ─ */
#teducas-auth-modal .teducas-auth__link {
    background: transparent !important;
    border: none !important;
    font-family: var(--e-global-typography-primary-font-family, "Inter"), sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--e-global-color-primary, #FACC15) !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: color 0.15s !important;
    box-shadow: none !important;
    text-decoration: none !important;
    display: inline !important;
}
#teducas-auth-modal .teducas-auth__link:hover {
    color: var(--e-global-color-accent, #EAB308) !important;
    text-decoration: underline !important;
    background: transparent !important;
}

/* ── Info text ─ */
.teducas-auth__info {
    font-size: 14px;
    color: #71717A;
    line-height: 1.5;
    margin: 0 0 16px;
}

/* ── Error / Success banners ─ */
.teducas-auth__error,
.teducas-auth__success {
    display: none;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    line-height: 1.4;
}
.teducas-auth__error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.teducas-auth__success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ── Primary button ─ */
#teducas-auth-modal .teducas-auth__btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 44px !important;
    padding: 0 24px !important;
    background: var(--e-global-color-primary, #FACC15) !important;
    color: var(--e-global-color-secondary, #18181B) !important;
    border: none !important;
    border-radius: 8px !important;
    font-family: var(--e-global-typography-primary-font-family, "Inter"), sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    position: relative !important;
    transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}
#teducas-auth-modal .teducas-auth__btn:hover:not(:disabled) {
    background: var(--e-global-color-accent, #EAB308) !important;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--e-global-color-accent, #EAB308) 30%, transparent) !important;
}
#teducas-auth-modal .teducas-auth__btn:active:not(:disabled) {
    transform: scale(0.98) !important;
}
#teducas-auth-modal .teducas-auth__btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* ── Spinner ─ */
.teducas-auth__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid color-mix(in srgb, #FFFFFF 30%, transparent);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: teducasSpin 0.6s linear infinite;
    position: absolute;
    right: 16px;
}
.teducas-auth__btn.teducas-auth__btn--loading .teducas-auth__btn-text,
.teducas-auth__btn--loading .teducas-auth__btn-text {
    opacity: 0;
}
.teducas-auth__btn.teducas-auth__btn--loading .teducas-auth__spinner,
.teducas-auth__btn--loading .teducas-auth__spinner {
    display: block;
}

/* ── Footer ─ */
.teducas-auth__footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #F4F4F5;
}
.teducas-auth__footer-text {
    font-size: 13px;
    color: #71717A;
}

/* ── Back to login ─ */
.teducas-auth__back-login {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: #71717A;
}

/* ── Lost Password: multi-step panels ─ */
.teducas-auth__step {
    display: none;
}
.teducas-auth__step.teducas-auth__step--active,
.teducas-auth__step--active {
    display: block;
}

/* ── Lost Password: code input ─ */
.teducas-auth__code-input {
    font-size: 28px !important;
    letter-spacing: 10px;
    text-align: center;
    font-weight: 600;
    height: 56px !important;
}

/* ── Animations ─ */
@keyframes teducasSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@keyframes teducasSpin {
    to { transform: rotate(360deg); }
}

/* ── Mobile: bottom sheet ─ */
@media (max-width: 540px) {
    .teducas-auth {
        align-items: flex-end;
        padding: 0;
    }
    .teducas-auth__container {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        padding: 24px 20px 20px;
    }
}
