/* Account Type — Figma 834:18126 / 834:18061 */

@font-face {
    font-family: 'Madani Arabic';
    src: url('../home/fonts/MadaniArabic-Light.ttf') format('truetype');
    font-weight: 300;
}

@font-face {
    font-family: 'Madani Arabic';
    src: url('../home/fonts/MadaniArabic-Regular.ttf') format('truetype');
    font-weight: 400;
}

@font-face {
    font-family: 'Madani Arabic';
    src: url('../home/fonts/MadaniArabic-Medium.ttf') format('truetype');
    font-weight: 500;
}

@font-face {
    font-family: 'Madani Arabic';
    src: url('../home/fonts/MadaniArabic-SemiBold.ttf') format('truetype');
    font-weight: 600;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
}

body.register-account-type {
    font-family: 'Madani Arabic', Tajawal, sans-serif;
    background: #fff;
    color: #181d27;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header: physical LTR like Figma (close left / logo right) ── */
.rat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 24px 80px;
    flex-shrink: 0;
    direction: ltr;
}

.rat-header__side {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rat-header__side--end {
    justify-content: flex-end;
}

.rat-close {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 10px;
    border-radius: 9999px;
    border: 1px solid #d5d7da;
    background: #fff;
    box-shadow: 0 1px 2px rgba(10, 13, 18, 0.05);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.rat-close img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Flag then EN — never reverse */
.rat-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    line-height: 20px;
    color: #414651;
    direction: ltr;
    flex-shrink: 0;
}

.rat-lang img {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}

.rat-progress {
    position: relative;
    width: 320px;
    max-width: 30vw;
    height: 8px;
    border-radius: 9999px;
    background: #e9eaeb;
    overflow: hidden;
    flex-shrink: 0;
}

/* Figma progress ~13.75% flush to the start side in design (= right in screenshots) */
.rat-progress__bar {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 13.75%;
    border-radius: 9999px;
    background: #6a19ff;
}

/* Brand logo: mark LEFT of wordmark — never mirrored */
.rat-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    direction: ltr;
}

.rat-logo__mark {
    width: 63.106px;
    height: 32px;
    display: block;
    flex-shrink: 0;
}

.rat-logo__word {
    width: 131.943px;
    height: 21.836px;
    display: block;
    flex-shrink: 0;
}

/* ── Main ── */
.rat-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 80px;
    width: 100%;
    padding: 48px 80px;
    min-height: 0;
}

.rat-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    text-align: center;
}

.rat-icon {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background: #eae5ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rat-icon img {
    width: 24px;
    height: 24px;
    display: block;
}

.rat-intro__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rat-intro__text h1 {
    margin: 0;
    font-size: 30px;
    line-height: 38px;
    font-weight: 400;
    color: #181d27;
}

.rat-intro__text p {
    margin: 0;
    font-size: 16px;
    line-height: normal;
    font-weight: 300;
    color: #414651;
}

.rat-cards {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 32px;
    width: 100%;
    flex-wrap: wrap;
}

.rat-card {
    position: relative;
    width: 256px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
    isolation: isolate;
    background: #fff;
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px #e9eaeb;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rat-card:hover {
    box-shadow: inset 0 0 0 1px #d5d7da;
}

.rat-card.is-selected {
    border-color: #7940ff;
    box-shadow: 0 0 0 4px #ede4ff;
}

.rat-card__title {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 32px 24px 8px;
    margin: 0;
    font-size: 24px;
    line-height: 32px;
    font-weight: 400;
    color: #181d27;
}

/*
 * Figma media stage is 384×249 inside a 256-wide card (overflow clipped).
 * Photo/glow sizes below match Figma absolute values on that 384 stage.
 */
.rat-card__media {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 249px;
    overflow: hidden;
}

.rat-card__stage {
    position: absolute;
    left: 50%;
    top: 0;
    width: 384px;
    height: 249px;
    transform: translateX(-50%);
}

.rat-card__glow {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.rat-card__glow img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    display: block;
}

/* Teacher glow: inset 22.46% -10.79% -28.96% -10.68% + rotate 180 + scaleX -1 */
.rat-card--teacher .rat-card__glow {
    inset: 22.46% -10.79% -28.96% -10.68%;
    transform: rotate(180deg) scaleX(-1);
}

.rat-card--teacher .rat-card__glow img {
    inset: -37.71% -21.44%;
    width: auto;
    height: auto;
}

/* Academy glow: inset -3.09% -0.12% 12.34% -6.25% */
.rat-card--academy .rat-card__glow {
    inset: -3.09% -0.12% 12.34% -6.25%;
}

.rat-card--academy .rat-card__glow img {
    inset: -44.26% -24.48%;
    width: auto;
    height: auto;
}

/* Instructor glow: inset -18.5% -16.48% 5.08% -16.48% */
.rat-card--instructor .rat-card__glow {
    inset: -18.5% -16.48% 5.08% -16.48%;
}

.rat-card--instructor .rat-card__glow img {
    inset: -35.41% -19.59%;
    width: auto;
    height: auto;
}

.rat-card__photo-wrap {
    position: absolute;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.rat-card__photo {
    position: absolute;
    max-width: none;
    display: block;
    pointer-events: none;
}

/* Teacher photo: 314×241 at left 35 / top 16, object-contain */
.rat-card--teacher .rat-card__photo-wrap {
    left: 35px;
    top: 16px;
    width: 314px;
    height: 241px;
}

.rat-card--teacher .rat-card__photo {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Academy photo: 326×251 at left 29 / top 6 — cropped img 109.84% × 143.24% */
.rat-card--academy .rat-card__photo-wrap {
    left: 29px;
    top: 6px;
    width: 326px;
    height: 251px;
}

.rat-card--academy .rat-card__photo {
    left: -4.92%;
    top: -18.57%;
    width: 109.84%;
    height: 143.24%;
    object-fit: cover;
}

/* Instructor photo: 317×244 at left 34 / top 13 — cropped img 94.81% × 123.31% */
.rat-card--instructor .rat-card__photo-wrap {
    left: 34px;
    top: 13px;
    width: 317px;
    height: 244px;
}

.rat-card--instructor .rat-card__photo {
    left: 2.6%;
    top: -3.31%;
    width: 94.81%;
    height: 123.31%;
    object-fit: cover;
}

/* ── Footer ── */
.rat-footer {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 24px 80px;
    border-top: 1px solid #e9eaeb;
    flex-shrink: 0;
}

.rat-footer.is-visible {
    display: flex;
}

.rat-continue {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 181px;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #6a19ff;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(10, 13, 18, 0.05);
}

.rat-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rat-continue:not(:disabled):hover {
    filter: brightness(1.05);
}

/* Shared button loaders (متابعة / الخطوة السابقة) */
.rad-btn,
.rat-continue {
    position: relative;
    gap: 8px;
}

.rad-btn__label,
.rat-continue__label {
    display: inline-flex;
    align-items: center;
}

.rad-btn__spinner,
.rat-continue__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    flex-shrink: 0;
    animation: rad-spin 0.7s linear infinite;
}

.rad-btn.is-loading,
.rat-continue.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.rad-btn.is-loading .rad-btn__spinner,
.rat-continue.is-loading .rat-continue__spinner {
    display: inline-block;
}

.rad-btn.is-loading .rad-btn__label,
.rat-continue.is-loading .rat-continue__label {
    opacity: 0.9;
}

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

@media (max-width: 1024px) {
    .rat-header,
    .rat-main,
    .rat-footer {
        padding-inline: 24px;
    }

    .rat-progress {
        max-width: 160px;
    }

    .rat-main {
        gap: 48px;
        padding-block: 32px;
    }

    .rat-cards {
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .rat-intro__text h1 {
        font-size: 24px;
        line-height: 32px;
    }

    .rat-card {
        width: min(256px, 100%);
    }

    .rat-logo__mark {
        width: 48px;
        height: 24px;
    }

    .rat-logo__word {
        width: 100px;
        height: 17px;
    }

    .rat-header {
        flex-wrap: wrap;
        gap: 16px;
    }

    .rat-progress {
        order: 3;
        width: 100%;
        max-width: none;
    }
}
