/* =====================================================================
   OSARH Pro — Auth design system (login + academy signup wizard)
   Matches Figma "Osarh Pro new dashboard" Register & Login frames.
   Brand tokens: primary #254CEF (Pro primary 2), bg gradient #FFF -> #CAE0FF.
   Font: PingARLT (already loaded by the front theme).
   ===================================================================== */

.osp-auth {
    --osp-primary: #254CEF;
    --osp-primary-hover: #1c3fce;
    --osp-primary-soft: #eaf0ff;
    --osp-bg-a: #ffffff;
    --osp-bg-b: #cae0ff;
    --osp-ink: #0f1626;
    --osp-ink-2: #3b4256;
    --osp-muted: #8a90a2;
    --osp-line: #e7eaf1;
    --osp-field: #f5f7fa;
    --osp-danger: #e5484d;
    --osp-radius: 16px;
    --osp-radius-sm: 10px;

    font-family: 'PingARLT', 'FFShamelFamily', 'Gotham', sans-serif;
    min-height: 100vh;
    display: flex;
    direction: ltr;
    align-items: stretch;
    background: linear-gradient(135deg, var(--osp-bg-a) 0%, var(--osp-bg-b) 100%);
    color: var(--osp-ink);
    box-sizing: border-box;
}

.osp-auth *,
.osp-auth *::before,
.osp-auth *::after {
    box-sizing: border-box;
}

/* ---------- Left promotional aside ---------- */
.osp-auth__aside {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.osp-promo {
    position: relative;
    width: 100%;
    max-width: 460px;
}

/* layered cards behind the main promo card */
.osp-promo__stack {
    position: relative;
    border-radius: 22px;
}

.osp-promo__stack::before,
.osp-promo__stack::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 24px 60px -30px rgba(37, 76, 239, 0.35);
    z-index: 0;
}

.osp-promo__stack::before {
    transform: translate(18px, -22px) rotate(-3deg);
    opacity: 0.55;
}

.osp-promo__stack::after {
    transform: translate(34px, -40px) rotate(-6deg);
    opacity: 0.3;
}

.osp-promo__card {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 22px;
    padding: 20px 20px 28px;
    box-shadow: 0 30px 70px -35px rgba(37, 76, 239, 0.45);
    text-align: center;
}

.osp-promo__media {
    border-radius: 16px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.osp-promo__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.osp-promo__slides {
    position: relative;
}

.osp-promo__slide {
    display: none;
}

.osp-promo__slide.is-active {
    display: block;
}

.osp-promo__title {
    margin: 22px 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--osp-primary);
}

.osp-promo__text {
    margin: 0;
    font-size: 13px;
    line-height: 1.9;
    color: var(--osp-ink-2);
    max-width: 380px;
    margin-inline: auto;
}

.osp-promo__dots {
    display: flex;
    gap: 7px;
    justify-content: center;
    margin-top: 22px;
}

.osp-promo__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c9d3ea;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: all 0.25s ease;
}

.osp-promo__dot.is-active {
    background: var(--osp-primary);
    width: 22px;
    border-radius: 5px;
}

/* ---------- Right main / card ---------- */
.osp-auth__main {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.osp-card {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border-radius: var(--osp-radius);
    box-shadow: 0 30px 80px -40px rgba(20, 40, 120, 0.35);
    padding: 34px 40px 40px;
}

/* The academy registration endpoint keeps its proven backend form contract.
   These scoped rules let that form use the new auth shell without leaking
   visual changes into legacy storefront forms. */
.osp-card .join-trainer-form .wizard-step-item {
    display: grid;
    gap: 14px;
}

.osp-card .join-trainer-form .form-group {
    position: relative;
    margin: 0;
}

.osp-card .join-trainer-form .form-group > svg {
    display: none;
}

.osp-card .join-trainer-form input:not([type="hidden"]) {
    width: 100%;
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: var(--osp-radius-sm);
    background: var(--osp-field);
    color: var(--osp-ink);
    padding: 0 15px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.osp-card .join-trainer-form input:not([type="hidden"]):focus {
    border-color: var(--osp-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 76, 239, 0.1);
}

.osp-card .join-trainer-form .form-hint,
.osp-card .join-trainer-form .form-group > span {
    color: var(--osp-muted) !important;
    font-size: 11px !important;
    line-height: 1.6;
}

.osp-card .join-trainer-form .form-footer {
    margin: 4px 0 0;
}

.osp-card .join-trainer-form .form-submit,
.osp-card .join-trainer-form .submit-button {
    width: 100%;
}

.osp-card .join-trainer-form .submit-button {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: var(--osp-primary);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
}

.osp-card .join-trainer-form .form-condition {
    color: var(--osp-muted);
    text-align: center;
    font-size: 12px;
    line-height: 1.7;
}

.osp-card .join-trainer-form .form-condition a {
    color: var(--osp-primary);
}

.osp-card .join-trainer-form .iti {
    width: 100%;
}

.osp-card:has(.join-trainer-form) {
    max-width: 560px;
    margin-block: 32px;
}

.osp-auth__main:has(.join-trainer-form) {
    align-items: flex-start;
    overflow-y: auto;
}

.osp-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

.osp-card__logo {
    display: inline-flex;
    align-items: center;
}

.osp-card__logo img {
    height: 40px;
    width: auto;
}

/* language toggle */
.osp-lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--osp-ink-2);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.osp-lang:hover {
    background: var(--osp-field);
    color: var(--osp-ink);
}

.osp-lang svg {
    width: 16px;
    height: 16px;
}

.osp-card__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--osp-ink);
    margin: 0 0 4px;
}

.osp-card__subtitle {
    font-size: 13px;
    line-height: 1.8;
    color: var(--osp-muted);
    margin: 0 0 22px;
    word-break: break-word;
}

/* ---------- Form fields ---------- */
.osp-field {
    margin-bottom: 16px;
    text-align: start;
}

.osp-field > label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--osp-ink-2);
    margin-bottom: 8px;
}

.osp-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.osp-input {
    width: 100%;
    height: 50px;
    background: var(--osp-field);
    border: 1px solid transparent;
    border-radius: var(--osp-radius-sm);
    padding: 0 16px;
    font-family: inherit;
    font-size: 14px;
    color: var(--osp-ink);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.osp-input::placeholder {
    color: #a7adbd;
}

.osp-input:focus {
    border-color: var(--osp-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 76, 239, 0.1);
}

.osp-input.error,
.osp-input.is-error {
    border-color: var(--osp-danger);
    background: #fff5f5;
}

/* eye toggle inside password */
.osp-eye {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--osp-muted);
    display: inline-flex;
}

.osp-eye svg {
    width: 20px;
    height: 20px;
}

/* password input keeps room for the eye */
.osp-input-wrap .osp-input[type="password"],
.osp-input-wrap .osp-input.has-eye {
    padding-inline-start: 44px;
}

.osp-domain {
    background: var(--osp-field);
    border: 1px solid transparent;
    border-radius: var(--osp-radius-sm);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.osp-domain:focus-within {
    border-color: var(--osp-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 76, 239, 0.1);
}

.osp-domain__input {
    min-width: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    text-align: end;
}

.osp-domain__input:focus {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.osp-domain__suffix {
    flex: 0 0 auto;
    padding-inline-end: 16px;
    color: var(--osp-muted);
    font-size: 13px;
    user-select: none;
}

.osp-field__hint {
    display: block;
    font-size: 11px;
    color: var(--osp-muted);
    margin-top: 6px;
}

.osp-field__error {
    display: none;
    font-size: 12px;
    color: var(--osp-danger);
    margin-top: 8px;
    text-align: center;
}

.osp-field__error.is-visible {
    display: block;
}

.osp-forgot {
    display: block;
    text-align: start;
    font-size: 12.5px;
    color: var(--osp-muted);
    text-decoration: none;
    margin: -4px 0 20px;
}

.osp-forgot:hover {
    color: var(--osp-primary);
}

/* ---------- Buttons ---------- */
.osp-btn {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.osp-btn--primary {
    background: var(--osp-primary);
    color: #fff;
    box-shadow: 0 14px 30px -14px rgba(37, 76, 239, 0.7);
}

.osp-btn--primary:hover {
    background: var(--osp-primary-hover);
}

.osp-btn--primary:disabled {
    opacity: 0.65;
    cursor: default;
}

.osp-btn--ghost {
    background: #fff;
    color: var(--osp-ink);
    border: 1px solid var(--osp-line);
}

.osp-btn--ghost:hover {
    background: var(--osp-field);
}

.osp-btn svg {
    width: 18px;
    height: 18px;
}

.osp-btn__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: osp-spin 0.7s linear infinite;
    display: none;
}

.osp-btn.is-loading .osp-btn__spinner {
    display: inline-block;
}

.osp-btn.is-loading .osp-btn__label,
.osp-btn.is-loading svg:not(.osp-btn__spinner) {
    display: none;
}

/* ---------- Divider ---------- */
.osp-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    color: var(--osp-muted);
    font-size: 13px;
}

.osp-divider::before,
.osp-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--osp-line);
}

/* ---------- Google button ---------- */
.osp-google {
    width: 100%;
    height: 48px;
    border: 1px solid var(--osp-line);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--osp-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.osp-google:hover {
    background: var(--osp-field);
    border-color: #d5dae6;
}

.osp-google img {
    width: 20px;
    height: 20px;
}

/* ---------- OTP boxes ---------- */
.osp-otp {
    display: flex;
    gap: 12px;
    direction: ltr;
    justify-content: center;
    margin-top: 8px;
}

.osp-otp input {
    width: 62px;
    height: 62px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--osp-ink);
    background: var(--osp-field);
    border: 1px solid var(--osp-line);
    border-radius: var(--osp-radius-sm);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.osp-otp input:focus {
    border-color: var(--osp-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 76, 239, 0.1);
}

.osp-otp.is-error input {
    border-color: var(--osp-danger);
    color: var(--osp-danger);
    background: #fff5f5;
}

.osp-resend {
    text-align: center;
    font-size: 13px;
    color: var(--osp-muted);
    margin-top: 18px;
}

.osp-resend button {
    background: none;
    border: 0;
    color: var(--osp-primary);
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.osp-resend button:disabled {
    color: var(--osp-muted);
    cursor: default;
}

/* ---------- Mobile verification ---------- */
.osp-card--verification {
    max-width: 500px;
}

.osp-verification {
    text-align: start;
}

.osp-verification__icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 14px;
    color: var(--osp-primary);
    background: var(--osp-primary-soft);
}

.osp-verification__icon svg {
    width: 25px;
    height: 25px;
}

.osp-verification__number {
    display: inline-block;
    color: var(--osp-ink-2);
    font-weight: 700;
    white-space: nowrap;
}

.osp-phone {
    position: relative;
    display: flex;
    direction: ltr;
}

.osp-phone .osp-input {
    padding-left: 76px;
}

.osp-phone__dial {
    position: absolute;
    z-index: 1;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    padding-right: 12px;
    border-right: 1px solid var(--osp-line);
    color: var(--osp-ink-2);
    font-size: 13px;
    line-height: 22px;
}

.osp-verification .osp-otp {
    justify-content: space-between;
    margin: 0;
}

.osp-verification .osp-otp input {
    flex: 1 1 0;
    min-width: 0;
    max-width: 76px;
}

.osp-verification .osp-resend {
    margin-top: 20px;
}

/* ---------- Wizard steps ---------- */
.osp-step {
    display: none;
    animation: osp-fade 0.25s ease;
}

.osp-step.is-active {
    display: block;
}

.osp-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.osp-back {
    background: var(--osp-field);
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--osp-ink-2);
    flex: 0 0 auto;
}

.osp-back svg {
    width: 16px;
    height: 16px;
}

/* mobile intl-tel-input tuning inside our field */
.osp-field .iti {
    width: 100%;
}

.osp-field .iti input {
    height: 50px;
    background: var(--osp-field);
    border: 1px solid transparent;
    border-radius: var(--osp-radius-sm);
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    direction: ltr;
}

.osp-field .iti input:focus {
    border-color: var(--osp-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 76, 239, 0.1);
}

/* ---------- Provisioning state ---------- */
.osp-provision {
    text-align: center;
    padding: 30px 4px 18px;
}

.osp-card--provisioning {
    max-width: 500px;
}

.osp-provision__loader {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    border-radius: 20px;
    background: var(--osp-primary-soft);
}

.osp-provision__loader img {
    display: block;
    width: 38px;
    height: 38px;
    object-fit: contain;
    animation: osp-spin 0.9s linear infinite;
}

.osp-provision__progress {
    width: 100%;
    height: 8px;
    margin: 26px 0 18px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--osp-primary-soft);
    direction: ltr;
}

.osp-provision__progress span {
    display: block;
    width: 12%;
    height: 100%;
    border-radius: inherit;
    background: var(--osp-primary);
    transition: width 0.45s ease;
}

.osp-provision__text {
    min-height: 28px;
    margin: 0;
    font-size: 15px;
    color: var(--osp-ink-2);
    font-weight: 600;
}

.osp-provision__hint {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.8;
    color: var(--osp-muted);
}

.osp-provision.is-ready .osp-provision__loader {
    background: #e9f8ef;
}

.osp-provision.is-ready .osp-provision__progress span {
    background: #23a566;
}

.osp-provision.is-failed .osp-provision__loader {
    background: #fff0f0;
}

.osp-provision.is-failed .osp-provision__progress span {
    background: var(--osp-danger);
}

.osp-provision.is-failed .osp-provision__text {
    color: var(--osp-danger);
}

.osp-terms {
    text-align: center;
    font-size: 12px;
    color: var(--osp-muted);
    margin-top: 18px;
    line-height: 1.7;
}

.osp-terms a {
    color: var(--osp-primary);
    text-decoration: none;
}

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

@keyframes osp-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .osp-auth {
        flex-direction: column;
    }

    .osp-auth__aside {
        display: none;
    }

    .osp-auth__main {
        padding: 24px 16px;
    }
}

@media (max-width: 520px) {
    .osp-card {
        padding: 26px 20px 30px;
        box-shadow: none;
        background: transparent;
    }

    .osp-otp input {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
}
