/* ============================================================
   CITYGO PLATFORM — AUTH PAGES  v2
   Design Tokens · RTL · Mobile-First
   ============================================================ */

:root {
    --gold-pre: #C99A45;
    --gold-normal: #A17B37;
    --gold-dark: #3C2E15;
    --gold-darker: #140F07;
    --gold-light: #F5E8C8;
    --gold-bg: #FDFAF4;
    --gray-text: #535353;
    --gray-dark: #1C1C1C;
    --gray-border: #F5F3F3;
    --gray-mid: #E8E4E4;
    --gray-light: #F9F9F9;
    --white: #FFFFFF;
    --danger: #C94545;
    --success: #45C980;
    --inactive: #9B9B9B;
    /* Account type accent colours */
    --customer-color: #c9dc20;
    --customer-bg: #EFF6FF;
    --partner-color: #A17B37;
    --partner-bg: #FDF6E7;
    --font-main: 'Zain', 'Noto Sans Arabic', sans-serif;
    --font-btn: 'Noto Sans Arabic', 'Zain', sans-serif;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;
    --trans: 0.25s ease;
}

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

html,
body {
    height: 100%;
    font-family: var(--font-main);
    background: var(--gold-bg);
    color: var(--gray-dark);
    direction: rtl;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}


/* ── BACKGROUND ─────────────────────────────────────────── */

.bg-pattern {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.hex {
    position: absolute;
    background: linear-gradient(135deg, var(--gold-light) 0%, transparent 70%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    opacity: 0.45;
    animation: hexFloat 12s ease-in-out infinite;
}

.hex-1 {
    width: 260px;
    height: 300px;
    top: -60px;
    left: -80px;
}

.hex-2 {
    width: 180px;
    height: 210px;
    bottom: 40px;
    right: -50px;
    animation-delay: 4s;
}

.hex-3 {
    width: 120px;
    height: 140px;
    top: 45%;
    left: -30px;
    animation-delay: 8s;
    opacity: 0.25;
}

@keyframes hexFloat {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-18px) rotate(4deg);
    }
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.20;
}

.orb-1 {
    width: 340px;
    height: 340px;
    background: var(--gold-pre);
    top: -80px;
    right: -80px;
    animation: orbPulse 8s ease-in-out infinite;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: var(--gold-dark);
    bottom: -60px;
    left: -60px;
    animation: orbPulse 10s ease-in-out infinite reverse;
}

@keyframes orbPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.20;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.28;
    }
}


/* ── WRAPPER ─────────────────────────────────────────────── */

.auth-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    gap: 20px;
}


/* ── CARD ────────────────────────────────────────────────── */

.auth-card {
    width: 100%;
    max-width: 500px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 1px rgba(161, 123, 55, .10), 0 8px 40px rgba(60, 46, 21, .12);
    overflow: hidden;
    animation: cardIn .55s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(28px) scale(.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}


/* ── BRAND ───────────────────────────────────────────────── */

.brand-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 28px 0;
}

.brand-logo {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--gold-pre) 0%, var(--gold-dark) 100%);
    display: grid;
    place-items: center;
    color: var(--white);
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(201, 154, 69, .35);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--gold-dark);
    letter-spacing: -.3px;
}

.brand-sub {
    font-size: 12px;
    font-weight: 400;
    color: var(--inactive);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}


/* ── MAIN TAB BAR ────────────────────────────────────────── */

.tab-bar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 22px 28px 0;
    background: var(--gray-light);
    border-radius: var(--radius-pill);
    padding: 4px;
}

.tab-btn {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    padding: 10px 8px;
    font-family: var(--font-btn);
    font-size: 14px;
    font-weight: 500;
    color: var(--inactive);
    cursor: pointer;
    transition: color var(--trans);
    white-space: nowrap;
}

.tab-btn i {
    font-size: 13px;
}

.tab-btn.active {
    color: var(--gold-dark);
}

.tab-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--white);
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 8px rgba(60, 46, 21, .10);
    transition: transform var(--trans);
    z-index: 1;
}

.tab-indicator.shifted {
    transform: translateX(calc(-100%));
}


/* ── FORM PANELS ─────────────────────────────────────────── */

.form-panel {
    display: none;
    padding: 24px 28px 32px;
    animation: fadeSlide .35s ease both;
}

.form-panel.active {
    display: block;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.panel-intro {
    margin-bottom: 20px;
}

.panel-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-dark);
    line-height: 1.3;
}

.wave {
    display: inline-block;
    animation: waveHand 1.5s ease-in-out .6s 2;
    transform-origin: 70% 80%;
}

@keyframes waveHand {
    0%,
    100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(-15deg);
    }
    40% {
        transform: rotate(15deg);
    }
    60% {
        transform: rotate(-10deg);
    }
    80% {
        transform: rotate(8deg);
    }
}

.panel-desc {
    font-size: 14px;
    color: var(--inactive);
    margin-top: 4px;
}


/* ── SOCIAL ──────────────────────────────────────────────── */

.social-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1.5px solid var(--gray-mid);
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 11px 12px;
    font-family: var(--font-btn);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-dark);
    cursor: pointer;
    transition: border-color var(--trans), background var(--trans), transform .15s;
}

.social-btn:hover {
    border-color: var(--gold-pre);
    background: var(--gold-bg);
    transform: translateY(-1px);
}

.social-btn:active {
    transform: scale(.98);
}

.social-btn i {
    font-size: 15px;
}

.social-btn .fa-google {
    color: #EA4335;
}

.divider-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 12px;
    color: var(--inactive);
}

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


/* ── ACCOUNT TYPE PICKER ─────────────────────────────────── */

.type-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.type-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border: 2px solid var(--gray-mid);
    border-radius: var(--radius-md);
    background: var(--white);
    cursor: pointer;
    text-align: right;
    transition: border-color var(--trans), background var(--trans), transform .15s;
    position: relative;
}

.type-card:hover {
    border-color: var(--gold-pre);
    transform: translateY(-1px);
}

.type-card.active.customer-active {
    border-color: var(--customer-color);
    background: var(--customer-bg);
}

.type-card.active.partner-active {
    border-color: var(--partner-color);
    background: var(--partner-bg);
}

.type-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    font-size: 17px;
    flex-shrink: 0;
}

.customer-icon {
    background: var(--customer-bg);
    color: var(--customer-color);
}

.type-card.active.customer-active .customer-icon {
    background: rgba(206, 246, 59, 0.679);
}

.partner-icon {
    background: var(--partner-bg);
    color: var(--partner-color);
}

.type-card.active.partner-active .partner-icon {
    background: rgba(161, 123, 55, .15);
}

.type-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    line-height: 1.3;
}

.type-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-dark);
}

.type-hint {
    font-size: 12px;
    color: var(--inactive);
    margin-top: 2px;
}

.type-check {
    font-size: 18px;
    opacity: 0;
    transition: opacity var(--trans), color var(--trans);
}

.type-card.active.customer-active .type-check {
    opacity: 1;
    color: var(--customer-color);
}

.type-card.active.partner-active .type-check {
    opacity: 1;
    color: var(--partner-color);
}


/* ── REG FORMS ───────────────────────────────────────────── */

.reg-form {
    display: none;
    animation: fadeSlide .3s ease both;
}

.reg-form.active {
    display: block;
}


/* ── FIELDS ──────────────────────────────────────────────── */

.field-group {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 7px;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
}

.label-row .field-label {
    margin-bottom: 0;
}

.forgot-link {
    font-size: 12px;
    color: var(--gold-normal);
    font-weight: 500;
    transition: color var(--trans);
}

.forgot-link:hover {
    color: var(--gold-pre);
    text-decoration: underline;
}

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

.input-icon {
    position: absolute;
    right: 14px;
    font-size: 15px;
    color: var(--inactive);
    pointer-events: none;
    transition: color var(--trans);
    z-index: 1;
}

.field-input {
    width: 100%;
    height: 48px;
    background: var(--gray-light);
    border: 1.5px solid var(--gray-border);
    border-radius: var(--radius-md);
    padding: 0 42px 0 16px;
    font-family: var(--font-main);
    font-size: 15px;
    color: var(--gray-dark);
    transition: border-color var(--trans), background var(--trans), box-shadow var(--trans);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.field-input::placeholder {
    color: var(--inactive);
    font-size: 14px;
}

.field-input:focus {
    border-color: var(--gold-pre);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(201, 154, 69, .14);
}

.input-wrap:focus-within .input-icon {
    color: var(--gold-pre);
}

.field-input.is-invalid {
    border-color: var(--danger);
    background: #fff8f8;
}

.field-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(201, 69, 69, .12);
}

.select-wrap {
    position: relative;
}

.field-select {
    padding-left: 36px;
    cursor: pointer;
}

.select-arrow {
    position: absolute;
    left: 12px;
    font-size: 11px;
    color: var(--inactive);
    pointer-events: none;
}

.toggle-pass {
    position: absolute;
    left: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--inactive);
    padding: 4px;
    display: grid;
    place-items: center;
    font-size: 15px;
    transition: color var(--trans);
}

.toggle-pass:hover {
    color: var(--gold-pre);
}

.field-error {
    display: block;
    font-size: 12px;
    color: var(--danger);
    margin-top: 5px;
    min-height: 16px;
}


/* ── STRENGTH BAR ────────────────────────────────────────── */

.strength-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 8px;
}

.strength-seg {
    height: 4px;
    background: var(--gray-mid);
    border-radius: var(--radius-pill);
    transition: background .3s;
}

.strength-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
    color: var(--inactive);
    transition: color .3s;
}

.strength-1 .strength-seg:nth-child(1) {
    background: var(--danger);
}

.strength-2 .strength-seg:nth-child(-n+2) {
    background: #E08C2A;
}

.strength-3 .strength-seg:nth-child(-n+3) {
    background: #D4B000;
}

.strength-4 .strength-seg {
    background: var(--success);
}


/* ── CHECKBOX ────────────────────────────────────────────── */

.check-row {
    margin-bottom: 20px;
}

.custom-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-text);
    user-select: none;
}

.custom-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 1.5px solid var(--gray-mid);
    border-radius: var(--radius-sm);
    background: var(--white);
    display: grid;
    place-items: center;
    margin-top: 1px;
    transition: border-color var(--trans), background var(--trans);
}

.checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: 2px solid var(--white);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity .15s;
    margin-top: -2px;
}

.custom-check input:checked~.checkmark {
    background: var(--gold-pre);
    border-color: var(--gold-pre);
}

.custom-check input:checked~.checkmark::after {
    opacity: 1;
}

.check-label {
    line-height: 1.45;
}

.terms-link {
    color: var(--gold-normal);
    font-weight: 600;
}

.terms-link:hover {
    text-decoration: underline;
}


/* ── SUBMIT BUTTON ───────────────────────────────────────── */

.submit-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--font-btn);
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s, opacity .2s;
}


/* Login default */

.submit-btn {
    background: linear-gradient(135deg, var(--gold-pre) 0%, var(--gold-dark) 100%);
    box-shadow: 0 6px 20px rgba(161, 123, 55, .30);
}


/* Customer */

.customer-btn {
    background: linear-gradient(135deg, var(--gold-pre) 0%, var(--gold-dark) 100%);
    box-shadow: 0 6px 20px rgba(161, 123, 55, .30);
}


/* Partner */

.partner-btn {
    background: linear-gradient(135deg, var(--gold-pre) 0%, var(--gold-dark) 100%);
    box-shadow: 0 6px 20px rgba(161, 123, 55, .30);
}

.submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .12);
    transform: translateX(100%);
    transition: transform .4s ease;
}

.submit-btn:hover:not(:disabled)::before {
    transform: translateX(-100%);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.submit-btn:active:not(:disabled) {
    transform: scale(.98);
}

.submit-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.btn-arrow {
    font-size: 14px;
}

.btn-spinner {
    display: none;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-spinner {
    display: inline-block;
}

.submit-btn.loading .btn-arrow {
    display: none;
}


/* ── TOAST ───────────────────────────────────────────────── */

.toast-wrap {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: transform .4s cubic-bezier(.22, 1, .36, 1), opacity .4s;
    width: max-content;
    max-width: calc(100vw - 32px);
}

.toast-wrap.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-dark);
    color: var(--white);
    border-radius: var(--radius-pill);
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

.toast-icon {
    font-size: 17px;
    color: var(--success);
    flex-shrink: 0;
}


/* ── FOOTER ──────────────────────────────────────────────── */

.auth-footer {
    font-size: 12px;
    color: var(--inactive);
    text-align: center;
}


/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 480px) {
    .brand-header {
        padding: 22px 20px 0;
    }
    .tab-bar {
        margin: 18px 20px 0;
    }
    .form-panel {
        padding: 20px 20px 28px;
    }
    .panel-title {
        font-size: 20px;
    }
    .social-row {
        gap: 8px;
    }
    .social-btn {
        font-size: 13px;
        padding: 10px 8px;
    }
    .type-picker {
        gap: 8px;
    }
    .type-card {
        padding: 12px 10px;
        gap: 10px;
    }
    .type-name {
        font-size: 14px;
    }
    .submit-btn {
        height: 50px;
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    .tab-btn span {
        display: none;
    }
    .tab-btn i {
        font-size: 16px;
    }
    .tab-btn {
        padding: 11px;
    }
    .type-hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}