/* ------------------------------------------------------------------------- */
/* accounts/auth_overlay.css — the marketing hash-route auth OVERLAY (#549).   */
/*                                                                             */
/* On live, the header "Join for Free" / "Log in" CTAs open #/join and         */
/* #/login/ as a MODAL laid over the current marketing page (dimmed backdrop,  */
/* X closes with no navigation), instead of leaving for a standalone page.     */
/* This reproduces that overlay. Every rule is scoped under `.auth-overlay` so */
/* loading it on marketing pages CANNOT leak into the webpack-bundle chrome;   */
/* the modal-paper + role-card look mirrors accounts/auth_modal.css (the       */
/* standalone /auth/ pages), so the two entry points stay visually identical.  */
/* ------------------------------------------------------------------------- */

/* Fixed full-viewport dimmed backdrop that centers the dialog. Hidden until   */
/* the hash router shows it (the [hidden] attribute wins via display:none).     */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: rgba(20, 12, 48, 0.72);   /* dimmed indigo, matches live overlay */
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.auth-overlay[hidden] { display: none; }

/* Only one step (join / login) is visible at a time. The `.single` variant sets
   display:block below at equal specificity, so [hidden] is qualified with
   `.single` here to out-specify it and reliably win regardless of source order. */
.auth-overlay .auth-modal.single[hidden],
.auth-overlay .auth-modal[hidden] { display: none; }

/* ---- the MUI "paper" dialog (mirror of auth_modal.css .auth-modal) -------- */
.auth-overlay .auth-modal {
    position: relative;
    width: 100%;
    max-width: 660px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 11px 15px -7px rgba(0,0,0,.2), 0 24px 38px 3px rgba(0,0,0,.14);
    overflow: hidden;
    box-sizing: border-box;
    font-family: "Open Sans", Helvetica, Arial, sans-serif;
}

/* single-panel role chooser: purple signup gradient / blue login. */
.auth-overlay .auth-modal.single {
    display: block;
    padding: 46px 40px 40px;
    text-align: center;
    background: #2f9be6;
}
.auth-overlay .auth-modal.single.signup {
    background: linear-gradient(120deg, #4d8ef0 0%, #7d57d4 100%);
}

/* close "X" — dark circle, top-right; JS intercepts it to close w/o nav. */
.auth-overlay .auth-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #5a5a5a;
    color: #fff;
    border: none;
    font-size: 20px;
    line-height: 38px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .auth-overlay .auth-close:hover { background: #6e6e6e; }
}

.auth-overlay .role-title {
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    margin: 6px 0 34px;
}

.auth-overlay .role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    max-width: 560px;
    margin: 0 auto;
}
.auth-overlay .role-col-left,
.auth-overlay .role-col-right { display: flex; flex-direction: column; gap: 22px; }

.auth-overlay .role-card {
    background: #f6f7f8;
    border-radius: 8px;
    text-decoration: none;
    color: #23282d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    transition: transform .12s ease, box-shadow .12s ease;
    min-height: 132px;
}
@media (hover: hover) and (pointer: fine) {
  .auth-overlay .role-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.2); }
}
.auth-overlay .role-card.student { min-height: 320px; }
.auth-overlay .role-card.student img { max-width: 220px; width: 100%; padding: 15px 0; }
.auth-overlay .role-card h2 { font-size: 24px; font-weight: 800; margin: 8px 0 0; }
.auth-overlay .role-card h3 { font-size: 17px; font-weight: 600; margin: 2px 0 0; color: #23282d; }

.auth-overlay .role-existing {
    display: inline-block;
    margin-top: 26px;
    color: #fff;
    font-size: 16px;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
}

/* ---- responsive: single-column cards on narrow screens ------------------- */
@media (max-width: 620px) {
    .auth-overlay .role-grid { grid-template-columns: 1fr; }
    .auth-overlay .role-card.student { min-height: 200px; }
    .auth-overlay .role-title { font-size: 24px; }
    .auth-overlay .auth-modal.single { padding: 40px 22px 30px; }
}

/* ---- #/join/teacher two-panel step (issue #1371) -------------------------- */
/* The "Create a FREE teacher account!" dialog live's modalJoinTeacher opens:  */
/* a purple identity panel beside the SSO method picker. Mirrors the two-panel */
/* rules of accounts/auth_modal.css (the standalone /auth/ pages), scoped      */
/* under .auth-overlay so nothing leaks into the marketing chrome. The picker  */
/* is the step the overlay shows; its "Sign up with email" link navigates to   */
/* the standalone page's ?method=email form.                                   */
.auth-overlay {
    --auth-blue: #2f9be6;
    --auth-navy: #17275b;
    --auth-red: #d94a3d;
    --auth-dark: #333333;
    --auth-indigo: #5b47d6;
    --auth-clever: #436cf7;
    --auth-link: #1966b3;
    --auth-field-border: #c9d2da;
}
.auth-overlay .auth-modal,
.auth-overlay .auth-modal * { box-sizing: border-box; }

.auth-overlay .auth-modal.pair {
    display: flex;
    max-width: 1000px;
    min-height: 600px;
    text-align: left;
}
/* keep [hidden] winning over the flex display above */
.auth-overlay .auth-modal.pair[hidden] { display: none; }

.auth-overlay .auth-left {
    flex: 0 0 43%;
    max-width: 43%;
    background: var(--auth-blue);
    color: #fff;
    padding: 34px 30px;
    display: flex;
    flex-direction: column;
}
.auth-overlay .auth-left.signup {
    background: linear-gradient(150deg, #5b8ef0 0%, #7d57d4 100%);
}
.auth-overlay .auth-left .welcome { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.auth-overlay .auth-left .blurb { font-size: 15px; line-height: 1.5; margin: 6px 0 0; }
.auth-overlay .auth-left .privacy {
    color: #fff;
    text-decoration: underline;
    font-size: 13px;
    text-align: center;
    margin-top: auto;
    padding-top: 16px;
}
.auth-overlay .auth-left ul.perks { list-style: none; padding: 0; margin: 18px 0 0; }
.auth-overlay .auth-left ul.perks li { position: relative; padding: 0 0 14px 30px; font-size: 15px; }
.auth-overlay .auth-left ul.perks li::before {
    content: "\2713";
    position: absolute; left: 0; top: 0;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(255,255,255,.25); color: #fff;
    font-size: 12px; line-height: 20px; text-align: center;
}
.auth-overlay .auth-left .supports { font-size: 13px; margin-top: 18px; }
.auth-overlay .auth-left .supports a, .auth-overlay .auth-left .terms a { color: #fff; text-decoration: underline; }
.auth-overlay .auth-left .terms { font-size: 12px; margin-top: 18px; line-height: 1.5; }

.auth-overlay .auth-right {
    flex: 1;
    background: #f7fafb;
    padding: 40px 44px;
    display: flex;
    flex-direction: column;
}
.auth-overlay .auth-right .panel-inner {
    width: 100%;
    max-width: 490px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.auth-overlay .auth-title {
    text-align: center;
    color: var(--auth-navy);
    font-size: 22px;
    font-weight: 800;
    margin: 4px 0 22px;
}
.auth-overlay .auth-subtitle { text-align: center; color: #444; font-size: 15px; margin: -12px 0 22px; }
.auth-overlay .auth-title.create {
    color: var(--auth-link);
    font-size: 34px;
    line-height: 1.15;
    margin-bottom: 8px;
}
.auth-overlay .auth-title.create .free { color: #ef6a3d; }

.auth-overlay .sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 12px;
}
.auth-overlay .sso-btn .ico { display: inline-flex; align-items: center; }
.auth-overlay .sso-btn.google { background: var(--auth-red); }
.auth-overlay .sso-btn.apple { background: var(--auth-dark); }
.auth-overlay .sso-btn.microsoft { background: var(--auth-blue); }
.auth-overlay .sso-btn.clever { background: var(--auth-clever); }
.auth-overlay .sso-btn.email { background: var(--auth-indigo); }

.auth-overlay .sso-row { display: flex; flex-wrap: wrap; gap: 12px; }
.auth-overlay .sso-row .sso-btn { flex: 1 1 0; min-width: 130px; margin-bottom: 0; }

.auth-overlay .sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 16px 0;
}
.auth-overlay .sso-divider::before, .auth-overlay .sso-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #dfe4e8;
}
.auth-overlay .sso-divider span { padding: 0 12px; }

/* email-step form (only rendered if a marketing URL carries ?method=email) */
.auth-overlay .auth-field { margin-bottom: 16px; }
.auth-overlay .auth-field-row.name-fields { display: flex; gap: 16px; }
.auth-overlay .auth-field-row.name-fields .auth-field { flex: 1 1 0; min-width: 0; }
.auth-overlay .auth-field > label.title,
.auth-overlay .auth-field > label.field-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--auth-navy);
    margin-bottom: 6px;
}
.auth-overlay .auth-input-wrap { position: relative; }
.auth-overlay .auth-field input {
    width: 100%;
    height: 55px;
    padding: 0 14px;
    border: 1px solid var(--auth-field-border);
    border-radius: 4px;
    font-size: 15px;
    background: #fff;
}
.auth-overlay .auth-field input:focus {
    outline: none;
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 3px rgba(47, 155, 230, 0.35);
}
.auth-overlay .auth-field input:user-invalid { border-color: #c0392b; }
.auth-overlay .auth-field input:user-invalid:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.25);
}
.auth-overlay .pw-show {
    position: absolute;
    right: 1px; top: 1px; bottom: 1px;
    width: 62px;
    border-left: 1px solid var(--auth-field-border);
    background: #fff;
    color: #8a97a3;
    font-size: 12px;
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 0 4px 4px 0;
}
.auth-overlay .auth-error { color: #c0392b; font-size: 13px; margin: 4px 0 0; }
.auth-overlay .auth-submit {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(90deg, #f6a86b 0%, #ef6fa0 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
    margin-top: 20px;
}

.auth-overlay .auth-foot {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 22px;
}
.auth-overlay .auth-foot a, .auth-overlay .auth-foot button {
    color: var(--auth-link);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    background: none; border: none; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .auth-overlay .auth-foot a:hover { text-decoration: underline; }
}

/* responsive: stack the two panels on narrow screens */
@media (max-width: 760px) {
    .auth-overlay .auth-modal.pair { flex-direction: column; min-height: 0; }
    .auth-overlay .auth-left, .auth-overlay .auth-right { flex: 1 1 auto; max-width: 100%; }
    .auth-overlay .auth-title.create { font-size: 26px; }
}
@media (max-width: 480px) {
    .auth-overlay .auth-field-row.name-fields { flex-direction: column; gap: 0; }
}
