:root {
    --auth-bg: #eef3f8;
    --auth-navy: #071453;
    --auth-navy-soft: #0d1b3a;
    --auth-orange: #FF7900;
    --auth-muted: #6b7280;
    --auth-border: #dbe3ee;
    --auth-card: #ffffff;
    --auth-tab-idle: #edf2f7;
    --auth-input-bg: #ffffff;
    --auth-radius: 14px;
}

.auth-page {
    min-height: calc(100vh - 40px);
    padding: 48px 16px 64px;
    background: var(--auth-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* EN / العربية toggle */
.sm-lang-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #d5dde8;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
    z-index: 20;
}

body.lang-ar .sm-lang-toggle {
    right: auto;
    left: 16px;
}

.sm-lang-toggle button {
    border: 0;
    background: transparent;
    color: var(--auth-navy);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 14px;
    cursor: pointer;
    min-width: 48px;
    line-height: 1.2;
}

.sm-lang-toggle button + button {
    border-left: 1px solid #d5dde8;
}

body.lang-ar .sm-lang-toggle button + button {
    border-left: 0;
    border-right: 1px solid #d5dde8;
}

.sm-lang-toggle button.active {
    background: var(--auth-navy);
    color: #fff;
}

body.lang-ar .auth-page,
body.lang-ar .auth-card,
body.lang-ar .auth-brand {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

body.lang-ar .sm-input .sm-input-icon {
    left: auto;
    right: 14px;
}

body.lang-ar .sm-input .form-control,
body.lang-ar .sm-input .form-select {
    padding-left: 14px;
    padding-right: 42px;
}

body.lang-ar .sm-input.has-toggle .form-control {
    padding-left: 46px;
}

body.lang-ar .sm-input-toggle {
    right: auto;
    left: 12px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
    max-width: 520px;
}

.auth-brand img,
.auth-brand .auth-logo-mark {
    width: min(220px, 68vw);
    height: auto;
    margin-bottom: 18px;
    display: inline-block;
}

.auth-brand .auth-eyebrow {
    margin: 0 0 10px;
    color: var(--auth-orange);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-brand h1 {
    margin: 0 0 8px;
    color: var(--auth-navy);
    font-size: clamp(1.75rem, 3vw, 2.15rem);
    font-weight: 800;
    line-height: 1.2;
}

.auth-brand p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 560px;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-top: 4px solid var(--auth-orange);
    border-radius: var(--auth-radius);
    box-shadow: 0 10px 30px rgba(7, 20, 83, 0.06);
    padding: 28px 28px 24px;
}

.auth-card-wide {
    max-width: 680px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    background: var(--auth-tab-idle);
    border-radius: 12px;
    margin-bottom: 24px;
}

.auth-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--auth-muted);
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-tab:hover {
    color: var(--auth-navy);
    text-decoration: none;
}

.auth-tab.active {
    background: var(--auth-navy);
    color: #fff;
}

.auth-card-title {
    margin: 0 0 6px;
    color: var(--auth-navy);
    font-size: 1.45rem;
    font-weight: 800;
}

.auth-card-subtitle {
    margin: 0 0 22px;
    color: var(--auth-muted);
    font-size: 0.95rem;
}

.auth-page .form-label {
    color: var(--auth-navy);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.auth-page .form-label .req {
    color: var(--auth-orange);
    margin-left: 2px;
}

.auth-page .form-control,
.auth-page .form-select {
    min-height: 48px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: var(--auth-input-bg);
    color: var(--auth-navy-soft);
    box-shadow: none;
}

.auth-page .form-control::placeholder {
    color: #9aa6b5;
}

.auth-page .form-control:focus,
.auth-page .form-select:focus {
    border-color: var(--auth-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 121, 0, 0.18);
}

.auth-page .form-text,
.auth-page .text-muted {
    color: var(--auth-muted) !important;
}

.auth-page .form-check-input:checked {
    background-color: var(--auth-navy);
    border-color: var(--auth-navy);
}

.auth-page .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(7, 20, 83, 0.15);
}

.auth-page .form-check-label {
    color: var(--auth-navy-soft);
}

.auth-btn {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--auth-orange);
    border-radius: 10px;
    background: var(--auth-orange);
    color: var(--auth-navy);
    font-weight: 800;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn:hover,
.auth-btn:focus {
    background: #e86d00;
    border-color: #e86d00;
    color: var(--auth-navy);
}

.auth-btn:disabled {
    opacity: 0.75;
}

.auth-btn-secondary {
    background: #fff;
    border: 1px solid var(--auth-border);
    color: var(--auth-navy);
}

.auth-btn-secondary:hover,
.auth-btn-secondary:focus {
    background: #f8fafc;
    border-color: #c9d4e3;
    color: var(--auth-navy);
}

.auth-hint {
    margin: 10px 0 0;
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.85rem;
}

.auth-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-border);
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--auth-orange);
    font-weight: 700;
    text-decoration: underline;
}

.auth-footer a:hover {
    color: #e86d00;
}

.auth-link {
    color: var(--auth-orange);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    color: #e86d00;
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--auth-muted);
    font-size: 0.9rem;
}

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

/* Icon inputs — no labels, placeholder + left icon */
.sm-input {
    position: relative;
    margin-bottom: 14px;
}

.sm-input .sm-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7c93;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 2;
}

.sm-input .form-control,
.sm-input .form-select {
    min-height: 50px;
    padding-left: 44px;
    border-radius: 12px;
    border: 1px solid #d5dde8;
}

.sm-input.has-toggle .form-control {
    padding-right: 46px;
}

.sm-input-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #6b7c93;
    cursor: pointer;
    padding: 4px;
    z-index: 2;
}

.sm-input-toggle:hover {
    color: var(--auth-navy);
}

.sm-input .form-text {
    margin-top: 6px;
    margin-left: 4px;
}

/* Phone: dial code + number */
.sm-phone {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 4px;
}

.sm-phone-dial {
    flex: 0 0 132px;
    max-width: 148px;
    min-height: 50px;
    border-radius: 12px;
    border: 1px solid #d5dde8;
    background: #fff;
    color: var(--auth-navy);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0 6px;
    cursor: pointer;
}

.sm-phone-number {
    flex: 1;
    min-width: 0;
}

.sm-phone-help {
    margin-top: 0;
    margin-bottom: 14px !important;
    font-size: 0.82rem;
    color: var(--auth-muted);
}

body.lang-ar .sm-phone {
    flex-direction: row-reverse;
}

body.lang-ar .sm-phone-dial {
    text-align: right;
}

/* Feature strip below form */
.sm-features {
    width: 100%;
    max-width: 720px;
    margin: 28px auto 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: stretch;
    background: linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.sm-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 10px;
    text-align: center;
    color: var(--auth-navy);
    border-right: 1px solid #dbe3ee;
}

.sm-feature:last-child {
    border-right: 0;
    color: var(--auth-orange);
}

.sm-feature svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sm-feature span {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
}

@media (max-width: 576px) {
    .auth-page {
        padding: 28px 12px 40px;
    }

    .auth-card {
        padding: 22px 16px 18px;
    }

    .auth-card-title {
        font-size: 1.25rem;
    }

    .sm-features {
        grid-template-columns: repeat(2, 1fr);
    }

    .sm-feature:nth-child(2) {
        border-right: 0;
    }

    .sm-feature:nth-child(1),
    .sm-feature:nth-child(2) {
        border-bottom: 1px solid #dbe3ee;
    }
}
