:root {
    --cr-navy: #01216e;
    --cr-navy-deep: #0a1845;
    --cr-blue: #1a3d8f;
    --cr-red: #cc0000;
    --cr-surface: #ffffff;
    --cr-bg: #eef2f8;
    --cr-bg-2: #f7f9fc;
    --cr-text: #1e2a3a;
    --cr-muted: #5a6b7d;
    --cr-border: #d5deea;
    --cr-ok: #0f7a4c;
    --cr-radius: 16px;
    --cr-shadow: 0 10px 30px rgba(1, 33, 110, 0.1);
    --cr-font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    --cr-display: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

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

.cr-body {
    font-family: var(--cr-font);
    color: var(--cr-text);
    direction: rtl;
    text-align: right;
    background:
        radial-gradient(1200px 500px at 90% -10%, rgba(26, 61, 143, 0.18), transparent 60%),
        radial-gradient(900px 420px at 0% 0%, rgba(204, 0, 0, 0.08), transparent 55%),
        linear-gradient(180deg, #f4f7fb 0%, #e8eef8 100%);
    -webkit-font-smoothing: antialiased;
}

.cr-shell {
    width: min(720px, 100%);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 0 calc(1.5rem + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.cr-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: calc(0.9rem + env(safe-area-inset-top)) 1.1rem 0.85rem;
    color: var(--cr-navy);
    border-bottom: 1px solid rgba(1, 33, 110, 0.08);
}

.cr-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.cr-brand__logo {
    flex: 0 0 auto;
    height: 48px;
    max-width: min(46vw, 168px);
    width: auto;
    object-fit: contain;
    display: block;
}

.cr-brand__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.cr-brand__text strong {
    font-family: var(--cr-display);
    font-size: 0.95rem;
    color: var(--cr-navy);
}

.cr-brand__text span {
    font-size: 0.78rem;
    color: var(--cr-muted);
}

.cr-badge {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    color: var(--cr-navy);
    background: rgba(1, 33, 110, 0.06);
    border: 1px solid rgba(1, 33, 110, 0.1);
    white-space: nowrap;
}

.cr-progress {
    height: 4px;
    background: rgba(1, 33, 110, 0.08);
}

.cr-progress__bar {
    height: 100%;
    width: 16%;
    background: linear-gradient(90deg, var(--cr-red), #e85a5a);
    transition: width 0.35s ease;
    margin-inline-start: auto;
}

.cr-steps {
    list-style: none;
    margin: 0;
    padding: 0.85rem 1rem 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
}

.cr-steps li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: var(--cr-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.cr-steps li span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 2px solid var(--cr-border);
    background: #fff;
}

.cr-steps li.is-active { color: var(--cr-navy); }
.cr-steps li.is-active span {
    border-color: var(--cr-navy);
    background: var(--cr-navy);
    color: #fff;
}
.cr-steps li.is-done span {
    border-color: var(--cr-ok);
    background: var(--cr-ok);
    color: #fff;
}

.cr-main {
    padding: 1rem 1.1rem 0;
    flex: 1;
}

.cr-notes {
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    border-radius: var(--cr-radius);
    background: #fff8e8;
    border: 1px solid #f0dfb0;
    color: #5c4a12;
    box-shadow: var(--cr-shadow);
}

.cr-notes h2 {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--cr-navy);
}

.cr-notes ul {
    margin: 0;
    padding: 0 1.1rem 0 0;
    display: grid;
    gap: 0.45rem;
}

.cr-notes li {
    font-size: 0.9rem;
    line-height: 1.55;
}

.cr-panel {
    background: var(--cr-surface);
    border: 1px solid rgba(1, 33, 110, 0.06);
    border-radius: var(--cr-radius);
    box-shadow: var(--cr-shadow);
    padding: 1.25rem 1.15rem 1.35rem;
    animation: cr-in 0.35s ease;
}

.cr-panel[hidden] { display: none !important; }

@keyframes cr-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cr-panel h1 {
    font-family: var(--cr-display);
    font-size: clamp(1.25rem, 5vw, 1.6rem);
    color: var(--cr-navy);
    margin: 0 0 0.55rem;
    font-weight: 800;
}

.cr-lead {
    margin: 0 0 1.15rem;
    color: var(--cr-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.cr-label {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--cr-navy);
    margin: 0.85rem 0 0.4rem;
}

.cr-required { color: var(--cr-red); font-weight: 800; }

.cr-input {
    width: 100%;
    border: 1.5px solid var(--cr-border);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--cr-text);
    background: var(--cr-bg-2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cr-input:focus {
    outline: none;
    border-color: var(--cr-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 61, 143, 0.12);
}

.cr-input--ltr {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.cr-otp {
    display: flex;
    gap: 0.45rem;
    justify-content: center;
    direction: ltr;
    margin: 0.35rem 0 0.25rem;
}

.cr-otp__digit {
    width: 2.65rem;
    height: 3.1rem;
    border: 1.5px solid var(--cr-border);
    border-radius: 12px;
    background: var(--cr-bg-2);
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    font-family: inherit;
    color: var(--cr-navy);
    direction: ltr;
    caret-color: var(--cr-navy);
}

.cr-otp__digit:focus {
    outline: none;
    border-color: var(--cr-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 61, 143, 0.12);
}

@media (max-width: 380px) {
    .cr-otp { gap: 0.3rem; }
    .cr-otp__digit {
        width: 2.3rem;
        height: 2.8rem;
        font-size: 1.15rem;
    }
}

.cr-hint {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--cr-muted);
    line-height: 1.5;
}

.cr-meta {
    display: grid;
    gap: 0.45rem;
    margin: 0.75rem 0 0.25rem;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #f3f6fb, #eaf0f8);
    border: 1px solid rgba(1, 33, 110, 0.08);
    font-size: 0.9rem;
}

.cr-meta strong { color: var(--cr-navy); }

.cr-substeps {
    display: flex;
    gap: 0.4rem;
    margin: 0 0 1rem;
    flex-wrap: wrap;
}

.cr-substeps span {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--cr-bg);
    color: var(--cr-muted);
    border: 1px solid var(--cr-border);
}

.cr-substeps span.is-active {
    background: rgba(1, 33, 110, 0.08);
    color: var(--cr-navy);
    border-color: rgba(1, 33, 110, 0.2);
}

.cr-substeps span.is-done {
    background: rgba(15, 122, 76, 0.1);
    color: var(--cr-ok);
    border-color: rgba(15, 122, 76, 0.25);
}

.cr-section[hidden] { display: none !important; }

.cr-nav {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.cr-nav--single { grid-template-columns: 1fr; }

.cr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.98rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.cr-btn:active { transform: scale(0.98); }
.cr-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.cr-btn--primary {
    background: linear-gradient(135deg, var(--cr-navy), var(--cr-blue));
    color: #fff;
    box-shadow: 0 8px 18px rgba(1, 33, 110, 0.22);
}

.cr-btn--ghost {
    background: #fff;
    color: var(--cr-navy);
    border: 1.5px solid var(--cr-border);
}

.cr-btn--sm {
    min-height: 40px;
    padding: 0 0.85rem;
    font-size: 0.86rem;
}

.cr-alert {
    margin: 0.85rem 0 0;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cr-alert--error {
    background: #fdecec;
    color: #8a1212;
    border: 1px solid #f3c1c1;
}

.cr-alert--success {
    background: #e8f7ef;
    color: #0f5a39;
    border: 1px solid #bfe5cf;
}

.cr-alert--info {
    background: #eef4fb;
    color: #1a3a5c;
    border: 1px solid #c5d6ea;
}

.cr-check {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    margin: 1rem 0;
    font-size: 0.92rem;
    line-height: 1.55;
}

.cr-check input {
    margin-top: 0.25rem;
    accent-color: var(--cr-navy);
    flex: 0 0 auto;
}

.cr-fee-link {
    color: var(--cr-navy);
    font-weight: 800;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
}

.cr-fee-box {
    margin: 0.35rem 0 0.75rem;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    background: #fff8e8;
    border: 1px solid #f0dfb0;
    color: #6a5310;
    font-size: 0.9rem;
    line-height: 1.55;
}

.cr-fee-box[hidden] { display: none !important; }

.cr-hours-bar {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: var(--cr-bg);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cr-navy);
}

.cr-hours-bar.is-invalid { color: var(--cr-red); background: #fdecec; }

.cr-course-rows {
    display: grid;
    gap: 0.65rem;
}

.cr-course-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: start;
}

.cr-course-row .select2-container { width: 100% !important; }

.cr-prereq-warn {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0.35rem 0.15rem 0;
    color: #b42318;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.45;
}

.cr-prereq-warn[hidden] { display: none !important; }

.cr-course-row__remove {
    min-width: 40px;
    min-height: 40px;
    border-radius: 10px;
    border: 1.5px solid var(--cr-border);
    background: #fff;
    color: var(--cr-red);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.select2-container--default .select2-selection--single {
    min-height: 48px;
    border: 1.5px solid var(--cr-border);
    border-radius: 12px;
    background: var(--cr-bg-2);
    padding: 0.35rem 0.5rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    color: var(--cr-text);
    padding-right: 8px;
    padding-left: 28px;
    font-family: var(--cr-font);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
    left: 8px;
    right: auto;
}

.select2-dropdown {
    border-color: var(--cr-border);
    font-family: var(--cr-font);
    direction: rtl;
    text-align: right;
}

.select2-results__option--highlighted[aria-selected] {
    background: var(--cr-navy) !important;
}

.cr-success {
    text-align: center;
    padding: 1rem 0.25rem 0.5rem;
}

.cr-success__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(15, 122, 76, 0.12);
    color: var(--cr-ok);
    font-size: 1.6rem;
}

.cr-success__icon--closed {
    background: rgba(1, 33, 110, 0.1);
    color: var(--cr-navy);
}

.cr-done-list {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
    text-align: right;
    display: grid;
    gap: 0.45rem;
}

.cr-done-list li {
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: var(--cr-bg);
    font-size: 0.9rem;
}

.cr-lost-phone {
    margin: 0.35rem 0 0.85rem;
}

.cr-link-btn {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    color: var(--cr-navy);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.cr-link-btn:hover {
    color: var(--cr-red);
}

.cr-dialog[hidden] {
    display: none !important;
}

.cr-dialog {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.cr-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 24, 69, 0.55);
}

.cr-dialog__panel {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(92vh, 920px);
    overflow: auto;
    background: var(--cr-surface);
    border-radius: var(--cr-radius);
    box-shadow: var(--cr-shadow);
    padding: 1.1rem 1.15rem 1.2rem;
}

.cr-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.cr-dialog__head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--cr-navy);
}

.cr-dialog__close {
    appearance: none;
    border: 0;
    background: var(--cr-bg);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--cr-muted);
}

.cr-dialog__lead {
    margin-top: 0;
    font-size: 0.92rem;
}

.cr-dialog__fields {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.cr-dialog__fields .cr-label {
    margin-top: 0.35rem;
}

.cr-dialog__nav {
    margin-top: 1rem;
}

.cr-stamp-box {
    margin: 0.65rem 0 0.35rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1.5px dashed rgba(26, 61, 143, 0.45);
    background: linear-gradient(180deg, #f7f9fd, #eef3fb);
    color: var(--cr-navy);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-align: center;
    direction: ltr;
    unicode-bidi: isolate;
}

.cr-work {
    margin: 0.85rem 0 0.25rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: #f3f6fb;
    border: 1px solid rgba(1, 33, 110, 0.1);
}

.cr-work[hidden] {
    display: none !important;
}

.cr-work__label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--cr-navy);
    margin-bottom: 0.45rem;
}

.cr-work__track {
    height: 8px;
    border-radius: 999px;
    background: rgba(1, 33, 110, 0.1);
    overflow: hidden;
}

.cr-work__bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cr-blue), #3d6fd4);
    transition: width 0.2s ease;
}

@media (max-width: 380px) {
    .cr-brand__text { display: none; }
}

@media (min-width: 640px) {
    .cr-shell { padding-bottom: 2rem; }
    .cr-main { padding-top: 1.25rem; }
    .cr-panel { padding: 1.6rem 1.5rem 1.7rem; }
}
