/* Shared responsive auth pages — admin, hub, rider, merchant */

:root {
    --auth-orange: #ef4f39;
    --auth-orange-deep: #c13f2d;
    --auth-orange-soft: rgba(239, 79, 57, 0.15);
    /* Soft off-white — not pure #fff */
    --auth-card: #f4f5f7;
    --auth-card-elevated: #fafbfc;
    --auth-card-border: rgba(15, 23, 42, 0.07);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        calc(5.5rem + env(safe-area-inset-top, 0px))
        max(1rem, env(safe-area-inset-right, 0px))
        max(1.25rem, env(safe-area-inset-bottom, 0px))
        max(1rem, env(safe-area-inset-left, 0px));
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Inter', system-ui, sans-serif;
    color: #fff;
}

.auth-page--top {
    align-items: flex-start;
    padding-top: calc(5.75rem + env(safe-area-inset-top, 0px));
}

.auth-page--dark {
    background:
        radial-gradient(circle at 50% 50%, rgba(239, 79, 57, 0.12) 0%, rgba(10, 11, 14, 1) 100%),
        #0a0b0d;
}

.auth-page--light {
    background:
        radial-gradient(circle at 50% 50%, rgba(239, 79, 57, 0.05) 0%, rgba(248, 250, 252, 1) 100%),
        #f8fafc;
    color: #0f172a;
}

.auth-page--admin {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: #0f172a;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(255, 90, 60, 0.12), transparent 45%),
        radial-gradient(ellipse at 80% 90%, rgba(255, 90, 60, 0.08), transparent 40%),
        #f8fafc;
}

.auth-page--dark::before,
.auth-page--light::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1.5px, transparent 1.5px);
    background-size: 32px 32px;
}

.auth-page--light::before {
    background-image: radial-gradient(rgba(15, 23, 42, 0.03) 1.5px, transparent 1.5px);
}

.auth-glow-blob {
    position: fixed;
    width: min(450px, 80vw);
    height: min(450px, 80vw);
    border-radius: 50%;
    filter: blur(120px);
    z-index: 1;
    pointer-events: none;
}

.auth-page--dark .auth-glow-blob {
    background: rgba(239, 79, 57, 0.22);
}

.auth-page--light .auth-glow-blob {
    background: rgba(239, 79, 57, 0.08);
}

.auth-glow-blob.blob-1 {
    top: -150px;
    left: -150px;
}

.auth-glow-blob.blob-2 {
    bottom: -150px;
    right: -150px;
}

.auth-back-btn {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top, 0px));
    left: max(1rem, env(safe-area-inset-left, 0px));
    z-index: 200;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem 0.5rem 0.75rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.auth-page--dark .auth-back-btn,
.auth-page--light .auth-back-btn {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.auth-page--dark .auth-back-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.8);
}

.auth-page--dark .auth-back-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.auth-page--light .auth-back-btn {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: rgba(15, 23, 42, 0.7);
}

.auth-page--light .auth-back-btn:hover {
    background: rgba(15, 23, 42, 0.08);
    color: #000;
}

.auth-page--admin .auth-back-btn {
    background: var(--auth-card);
    border: 1px solid #e2e8f0;
    color: #64748b;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.auth-page--admin .auth-back-btn:hover {
    color: #0f172a;
    border-color: #cbd5e1;
}

.auth-back-btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: clamp(1rem, 3vw, 1.5rem);
}

.auth-page--dark .auth-card {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 50px rgba(239, 79, 57, 0.05);
}

.auth-page--light .auth-card {
    background: var(--auth-card);
    border: 1px solid var(--auth-card-border);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 18px 40px rgba(15, 23, 42, 0.06),
        0 0 40px rgba(239, 79, 57, 0.03);
}

.auth-page--admin .auth-card {
    background: var(--auth-card);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.75) inset,
        0 8px 28px rgba(15, 23, 42, 0.07);
}

.auth-card--wide {
    max-width: 720px;
}

.auth-card--medium {
    max-width: 440px;
}

.auth-heading {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    font-weight: 600;
    margin: 0 0 0.5rem;
    text-align: center;
}

.auth-subtitle {
    font-size: 0.8125rem;
    line-height: 1.55;
    text-align: center;
    margin: 0 0 1.75rem;
}

.auth-page--dark .auth-subtitle {
    color: #9a9da8;
}

.auth-page--light .auth-subtitle,
.auth-page--admin .auth-subtitle {
    color: #64748b;
}

.auth-form-group {
    margin-bottom: 1.125rem;
}

.auth-form-group label,
.auth-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.auth-page--dark .auth-label {
    color: #9a9da8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.auth-page--light .auth-label,
.auth-page--admin .auth-label {
    color: #64748b;
}

.auth-page--admin .auth-label {
    font-size: 0.78rem;
    text-transform: none;
    color: #0f172a;
}

.auth-input,
.auth-page input[type='text'],
.auth-page input[type='password'],
.auth-page input[type='email'],
.auth-page input[type='tel'] {
    width: 100%;
    font: inherit;
    font-size: max(16px, 0.875rem);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-page--dark .auth-input,
.auth-page--dark input[type='text'],
.auth-page--dark input[type='password'],
.auth-page--dark input[type='email'],
.auth-page--dark input[type='tel'] {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.auth-page--light .auth-input,
.auth-page--light input[type='text'],
.auth-page--light input[type='password'],
.auth-page--light input[type='email'],
.auth-page--light input[type='tel'] {
    background: var(--auth-card-elevated);
    border: 1px solid rgba(15, 23, 42, 0.09);
    color: #0f172a;
}

.auth-page--admin .auth-input,
.auth-page--admin input[type='text'],
.auth-page--admin input[type='password'],
.auth-page--admin input[type='email'],
.auth-page--admin input[type='tel'] {
    height: 42px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: var(--auth-card-elevated);
    color: #0f172a;
    font-size: 0.84rem;
}

.auth-page--dark .auth-input:focus,
.auth-page--dark input:focus {
    border-color: var(--auth-orange);
    box-shadow: 0 0 10px rgba(239, 79, 57, 0.2);
}

.auth-page--light .auth-input:focus,
.auth-page--light input:focus {
    border-color: var(--auth-orange);
    box-shadow: 0 0 10px rgba(239, 79, 57, 0.15);
}

.auth-page--admin .auth-input:focus,
.auth-page--admin input:focus {
    border-color: #ff5a3c;
    box-shadow: 0 0 0 3px #fff1ee;
}

.auth-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font: inherit;
    font-weight: 700;
    font-size: 0.875rem;
    color: #fff;
    cursor: pointer;
    background: var(--auth-orange);
    transition: background 0.2s ease, transform 0.1s ease;
}

.auth-page--admin .auth-btn {
    height: 44px;
    padding: 0;
    border-radius: 8px;
    background: #ff5a3c;
}

.auth-page--admin .auth-btn:hover {
    background: #e84a2e;
}

.auth-btn:hover {
    background: var(--auth-orange-deep);
}

.auth-btn:active {
    transform: scale(0.99);
}

.auth-error {
    color: #ef4f39;
    font-size: 0.75rem;
    margin-top: 0.375rem;
    font-weight: 500;
}

.auth-page--admin .auth-error {
    color: #dc2626;
}

.auth-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: -0.25rem 0 1.25rem;
}

.auth-meta-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: none;
    cursor: pointer;
}

.auth-meta-row a,
.auth-link {
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
}

.auth-page--dark .auth-meta-row a,
.auth-page--dark .auth-link {
    color: #9a9da8;
}

.auth-page--light .auth-meta-row a,
.auth-page--light .auth-link,
.auth-page--admin .auth-meta-row a,
.auth-page--admin .auth-link {
    color: #64748b;
}

.auth-link--accent,
.auth-page--light .auth-link-row a {
    color: var(--auth-orange);
    font-weight: 600;
}

.auth-link:hover,
.auth-meta-row a:hover {
    color: var(--auth-orange);
}

.auth-link-row {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.8125rem;
}

.auth-page--dark .auth-link-row {
    color: #9a9da8;
}

.auth-page--light .auth-link-row {
    color: #64748b;
}

.auth-phone-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.auth-page--dark .auth-phone-wrap {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-page--light .auth-phone-wrap {
    background: var(--auth-card-elevated);
    border: 1px solid rgba(15, 23, 42, 0.09);
}

.auth-phone-prefix {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    font-weight: 600;
    font-size: 0.84rem;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.auth-page--dark .auth-phone-prefix {
    background: rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.auth-page--light .auth-phone-prefix {
    background: rgba(15, 23, 42, 0.03);
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.auth-phone-wrap input {
    flex: 1;
    min-width: 0;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0.75rem 0.875rem !important;
}

.auth-banner {
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 0.8125rem;
    margin-bottom: 1.125rem;
    text-align: center;
}

.auth-banner--success {
    background: rgba(82, 201, 150, 0.15);
    border: 1px solid rgba(82, 201, 150, 0.3);
    color: #52c996;
}

.auth-page--admin .auth-banner--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.auth-brand-logo {
    height: clamp(2.75rem, 8vw, 3.5rem);
    width: auto;
    max-width: min(240px, 70vw);
    object-fit: contain;
}

.auth-otp-input {
    text-align: center;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.2em;
}

@media (max-width: 480px) {
    .auth-page {
        padding-top: calc(4.75rem + env(safe-area-inset-top, 0px));
    }

    .auth-back-btn {
        padding: 0.45rem 0.7rem 0.45rem 0.6rem;
        font-size: 0.75rem;
    }

    .auth-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-phone-prefix {
        padding: 0.65rem 0.7rem;
        font-size: 0.78rem;
    }
}

/* Register / wide forms */
.auth-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.auth-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1.75rem;
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 0.625rem 1rem;
    overflow-x: auto;
}

.auth-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.auth-step-num {
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.auth-step.active .auth-step-num,
.auth-step.done .auth-step-num {
    background: var(--auth-orange);
    color: #fff;
}

.auth-step.pending .auth-step-num {
    background: rgba(15, 23, 42, 0.08);
    color: #64748b;
}

.auth-step-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.auth-step.active .auth-step-label {
    color: #0f172a;
}

.auth-step-sep {
    width: 1.5rem;
    height: 1px;
    background: rgba(15, 23, 42, 0.08);
    flex-shrink: 0;
    margin: 0 0.25rem;
}

.auth-timer-row {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.8125rem;
    color: #64748b;
}

.auth-resend-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--auth-orange);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .auth-form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .auth-steps {
        padding: 0.5rem 0.75rem;
    }
}

/* Merchant Portal soft card on dark page bg */
.auth-card--merchant {
    background: var(--auth-card) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.65) inset,
        0 20px 44px rgba(0, 0, 0, 0.28),
        0 0 50px rgba(239, 79, 57, 0.04) !important;
    color: #0f172a !important;
}

.auth-card--merchant .auth-heading {
    color: #0f172a !important;
}

.auth-card--merchant .auth-subtitle {
    color: #475569 !important;
}

.auth-card--merchant .auth-label {
    color: #475569 !important;
}

.auth-card--merchant .auth-input,
.auth-card--merchant input[type='text'],
.auth-card--merchant input[type='password'],
.auth-card--merchant input[type='email'],
.auth-card--merchant input[type='tel'] {
    background: var(--auth-card-elevated) !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

.auth-card--merchant .auth-input:focus,
.auth-card--merchant input:focus {
    border-color: var(--auth-orange) !important;
    box-shadow: 0 0 10px rgba(239, 79, 57, 0.15) !important;
}

.auth-card--merchant .auth-phone-wrap {
    background: var(--auth-card-elevated) !important;
    border: 1px solid #cbd5e1 !important;
}

.auth-card--merchant .auth-phone-prefix {
    background: #eceef2 !important;
    border-right: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

.auth-card--merchant .auth-meta-row a,
.auth-card--merchant .auth-link {
    color: #64748b !important;
}

.auth-card--merchant .auth-meta-row a:hover,
.auth-card--merchant .auth-link:hover {
    color: var(--auth-orange) !important;
}

.auth-card--merchant .auth-link-row {
    color: #475569 !important;
}

.auth-card--merchant .auth-banner--success {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #047857 !important;
}

.auth-card--merchant .auth-resend-link {
    color: var(--auth-orange) !important;
}

.auth-card--merchant .auth-timer-row {
    color: #64748b !important;
}

.auth-card--merchant .auth-step-num {
    background: rgba(15, 23, 42, 0.08) !important;
    color: #64748b !important;
}

.auth-card--merchant .auth-step.active .auth-step-num,
.auth-card--merchant .auth-step.done .auth-step-num {
    background: var(--auth-orange) !important;
    color: #ffffff !important;
}

.auth-card--merchant .auth-step-label {
    color: #64748b !important;
}

.auth-card--merchant .auth-step.active .auth-step-label {
    color: #0f172a !important;
}
