/* ═══════════════════════════════════════════════════════════════════════════
   TEDUCAS Auth Modal — Default Black & White Theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 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: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, 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-modal .teducas-auth__container,
.teducas-auth .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,
.teducas-auth .teducas-auth__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    color: #71717a;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    box-shadow: none;
    padding: 0;
}

#teducas-auth-modal .teducas-auth__close:hover,
.teducas-auth .teducas-auth__close:hover {
    background-color: #f4f4f5;
    color: #09090b;
}

/* ── 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: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #09090b;
    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,
.teducas-auth .teducas-auth__tabs {
    display: flex;
    position: relative;
    border-bottom: 1px solid #e4e4e7;
    margin-bottom: 24px;
}

#teducas-auth-modal .teducas-auth__tab,
.teducas-auth .teducas-auth__tab {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-radius: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #71717a;
    cursor: pointer;
    transition: color 0.2s ease;
    box-shadow: none;
}

#teducas-auth-modal .teducas-auth__tab:hover,
.teducas-auth .teducas-auth__tab:hover {
    color: #09090b;
    background: transparent;
}

#teducas-auth-modal .teducas-auth__tab.teducas-auth__tab--active,
#teducas-auth-modal .teducas-auth__tab--active,
.teducas-auth .teducas-auth__tab.teducas-auth__tab--active,
.teducas-auth .teducas-auth__tab--active {
    color: #09090b;
    background: transparent;
    font-weight: 600;
}

#teducas-auth-modal .teducas-auth__tab-indicator,
.teducas-auth .teducas-auth__tab-indicator {
    position: absolute;
    bottom: -1px;
    height: 2px;
    background: #09090b;
    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: #09090b;
    margin-bottom: 6px;
}

#teducas-auth-modal .teducas-auth__field input[type="text"],
#teducas-auth-modal .teducas-auth__field input[type="email"],
#teducas-auth-modal .teducas-auth__field input[type="password"],
.teducas-auth .teducas-auth__field input[type="text"],
.teducas-auth .teducas-auth__field input[type="email"],
.teducas-auth .teducas-auth__field input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: #ffffff;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    color: #09090b;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#teducas-auth-modal .teducas-auth__field input:focus,
.teducas-auth .teducas-auth__field input:focus {
    border-color: #09090b;
    box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.1);
}

.teducas-auth__field input::placeholder {
    color: #a1a1aa;
}

/* ── Password wrapper ─ */
.teducas-auth__pass-wrap {
    position: relative;
}

#teducas-auth-modal .teducas-auth__pass-wrap input,
.teducas-auth .teducas-auth__pass-wrap input {
    padding-right: 44px;
}

#teducas-auth-modal .teducas-auth__toggle-pass,
.teducas-auth .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: #71717a;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

#teducas-auth-modal .teducas-auth__toggle-pass:hover,
.teducas-auth .teducas-auth__toggle-pass:hover {
    background-color: #f4f4f5;
    color: #09090b;
}

#teducas-auth-modal .teducas-auth__toggle-pass.teducas-auth__toggle-pass--visible,
#teducas-auth-modal .teducas-auth__toggle-pass--visible,
.teducas-auth .teducas-auth__toggle-pass.teducas-auth__toggle-pass--visible,
.teducas-auth .teducas-auth__toggle-pass--visible {
    color: #09090b;
}

/* ── Password strength ─ */
.teducas-auth__strength {
    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: #09090b;
    cursor: pointer;
    user-select: none;
}

.teducas-auth__check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #09090b;
    border-radius: 4px;
}

/* ── Links ─ */
#teducas-auth-modal .teducas-auth__link,
.teducas-auth .teducas-auth__link {
    background: transparent;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #09090b;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
    box-shadow: none;
    text-decoration: none;
    display: inline;
}

#teducas-auth-modal .teducas-auth__link:hover,
.teducas-auth .teducas-auth__link:hover {
    color: #27272a;
    text-decoration: underline;
    background: transparent;
}

/* ── 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,
.teducas-auth .teducas-auth__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    padding: 0 24px;
    background-color: #09090b;
    color: #ffffff;
    border: 1px solid #09090b;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-transform: none;
    letter-spacing: normal;
}

#teducas-auth-modal .teducas-auth__btn:hover:not(:disabled),
.teducas-auth .teducas-auth__btn:hover:not(:disabled) {
    background-color: #27272a;
    border-color: #27272a;
    color: #ffffff;
}

#teducas-auth-modal .teducas-auth__btn:active:not(:disabled),
.teducas-auth .teducas-auth__btn:active:not(:disabled) {
    transform: scale(0.98);
}

#teducas-auth-modal .teducas-auth__btn:disabled,
.teducas-auth .teducas-auth__btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Spinner ─ */
.teducas-auth__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    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-modal .teducas-auth__code-input,
.teducas-auth .teducas-auth__code-input {
    font-size: 28px;
    letter-spacing: 10px;
    text-align: center;
    font-weight: 600;
    height: 56px;
}

/* ── 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-modal .teducas-auth__container,
    .teducas-auth .teducas-auth__container {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        padding: 24px 20px 20px;
    }
}
