:root {
    --auth-primary: #dc2626;
    --auth-primary-dark: #b91c1c;
    --auth-primary-soft: #fee2e2;
    --auth-bg: #f4f6fb;
    --auth-surface: #ffffff;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

body {
    background:
        radial-gradient(circle at 15% 10%, rgba(220, 38, 38, 0.14), transparent 32%),
        radial-gradient(circle at 85% 90%, rgba(37, 99, 235, 0.12), transparent 34%),
        var(--auth-bg);
}

.auth-screen {
    width: 100%;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(360px, 520px) minmax(360px, 520px);
    justify-content: center;
    align-items: center;
    gap: 28px;
    padding: 28px;
    overflow: hidden;
}

.auth-device {
    width: 100%;
    min-height: min(860px, calc(100dvh - 56px));
    max-height: calc(100dvh - 56px);
    overflow-y: auto;
    position: relative;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 36px;
    padding: 20px;
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(18px);
    scrollbar-width: thin;
}

.auth-device::-webkit-scrollbar {
    width: 6px;
}

.auth-device::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 99px;
}

.auth-bg-circle {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
}

.circle-one {
    width: 170px;
    height: 170px;
    background: rgba(220, 38, 38, 0.12);
    top: -60px;
    right: -50px;
}

.circle-two {
    width: 120px;
    height: 120px;
    background: rgba(37, 99, 235, 0.10);
    bottom: 90px;
    left: -60px;
}

.auth-header,
.auth-hero-card,
.auth-card {
    position: relative;
    z-index: 2;
}

.auth-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.auth-icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    color: var(--auth-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    flex: 0 0 auto;
}

.auth-icon-btn ion-icon {
    font-size: 23px;
}

.auth-header-text {
    min-width: 0;
}

.auth-header-text h1 {
    margin: 0;
    color: var(--auth-text);
    font-size: 26px;
    font-weight: 950;
    letter-spacing: -0.7px;
}

.auth-header-text p {
    margin: 4px 0 0;
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 750;
}

.auth-hero-card {
    background:
        linear-gradient(135deg, rgba(220, 38, 38, 0.98), rgba(239, 68, 68, 0.96)),
        var(--auth-primary);
    color: #ffffff;
    border-radius: 30px;
    padding: 18px;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 20px 44px rgba(220, 38, 38, 0.26);
    margin-bottom: 16px;
    overflow: hidden;
}

.auth-hero-card::after {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    right: -70px;
    top: -70px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

.auth-logo-box {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    flex: 0 0 auto;
    box-shadow: 0 12px 28px rgba(127, 29, 29, 0.18);
    z-index: 2;
}

.auth-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 19px;
}

.auth-hero-text {
    min-width: 0;
    z-index: 2;
}

.auth-hero-text span {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 950;
    margin-bottom: 9px;
}

.auth-hero-text h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 950;
    letter-spacing: -0.4px;
}

.auth-hero-text p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

.auth-card {
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.08);
}

.auth-section-title {
    margin-bottom: 16px;
}

.auth-section-title h3 {
    margin: 0;
    color: var(--auth-text);
    font-size: 19px;
    font-weight: 950;
    letter-spacing: -0.3px;
}

.auth-section-title p {
    margin: 5px 0 0;
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 750;
}

.auth-label {
    display: block;
    color: var(--auth-text);
    font-size: 13.5px;
    font-weight: 950;
    margin: 14px 0 8px;
}

.auth-input-row {
    min-height: 54px;
    border: 1px solid var(--auth-border);
    background: #f8fafc;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 15px;
    transition: 0.18s ease;
}

.auth-input-row:focus-within {
    border-color: rgba(220, 38, 38, 0.55);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.auth-input-row ion-icon {
    font-size: 21px;
    color: var(--auth-primary);
    flex: 0 0 auto;
}

.auth-input-row input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--auth-text);
    font-size: 15px;
    font-weight: 750;
}

.auth-input-row input::placeholder {
    color: #94a3b8;
}

.auth-main-btn {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--auth-primary), #ef4444);
    color: #ffffff;
    margin-top: 20px;
    font-size: 15px;
    font-weight: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 16px 34px rgba(220, 38, 38, 0.28);
    transition: 0.18s ease;
}

.auth-main-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(220, 38, 38, 0.34);
}

.auth-main-btn:disabled {
    opacity: 0.74;
    cursor: not-allowed;
    transform: none;
}

.auth-main-btn ion-icon {
    font-size: 20px;
}

.auth-bottom-text {
    text-align: center;
    margin: 17px 0 0;
    color: var(--auth-muted);
    font-size: 13.5px;
    font-weight: 750;
}

.auth-bottom-text a {
    color: var(--auth-primary);
    font-weight: 950;
}

.auth-desktop-panel {
    width: 100%;
    min-height: 620px;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(127, 29, 29, 0.92)),
        #111827;
    border-radius: 38px;
    padding: 34px;
    color: #ffffff;
    box-shadow: var(--auth-shadow);
    position: relative;
    overflow: hidden;
}

.auth-desktop-panel::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    top: -120px;
    right: -120px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.auth-desktop-panel::after {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    bottom: -90px;
    left: -70px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.28);
}

.desktop-panel-inner {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.desktop-panel-inner img {
    width: 104px;
    height: 104px;
    border-radius: 28px;
    object-fit: cover;
    background: #ffffff;
    padding: 4px;
    margin-bottom: 26px;
}

.desktop-panel-inner h2 {
    margin: 0;
    font-size: 38px;
    line-height: 1.12;
    font-weight: 950;
    letter-spacing: -1.4px;
    max-width: 420px;
}

.desktop-panel-inner p {
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15.5px;
    line-height: 1.7;
    font-weight: 650;
    max-width: 430px;
}

.desktop-feature-list {
    display: grid;
    gap: 12px;
    margin-top: 30px;
}

.desktop-feature-list div {
    min-height: 54px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.13);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px;
    font-weight: 850;
}

.desktop-feature-list ion-icon {
    font-size: 23px;
    color: #fecaca;
}

.mini-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 999px;
    animation: authSpin 0.75s linear infinite;
}

@keyframes authSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 980px) {
    .auth-screen {
        display: block;
        padding: 0;
        background: var(--auth-bg);
    }

    .auth-device {
        width: 100%;
        max-height: none;
        min-height: 100dvh;
        border-radius: 0;
        border: 0;
        box-shadow: none;
        padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 34px;
        background:
            radial-gradient(circle at 90% 0%, rgba(220, 38, 38, 0.13), transparent 32%),
            var(--auth-bg);
    }

    .auth-desktop-panel {
        display: none;
    }

    .auth-card {
        border-radius: 28px;
    }
}

@media (max-width: 420px) {
    .auth-hero-card {
        padding: 16px;
        border-radius: 26px;
        align-items: flex-start;
    }

    .auth-logo-box {
        width: 62px;
        height: 62px;
        border-radius: 21px;
    }

    .auth-logo-box img {
        border-radius: 16px;
    }

    .auth-hero-text h2 {
        font-size: 20px;
    }

    .auth-hero-text p {
        font-size: 12.5px;
    }

    .auth-card {
        padding: 17px;
    }

    .auth-header-text h1 {
        font-size: 24px;
    }

    .auth-input-row {
        min-height: 52px;
    }

    /* Register OTP Step */
    .otp-top-box {
        text-align: center;
        padding: 10px 8px 18px;
    }

    .otp-icon-wrap {
        width: 74px;
        height: 74px;
        margin: 0 auto 12px;
        border-radius: 28px;
        background: var(--primary-soft);
        color: var(--primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .otp-icon-wrap ion-icon {
        font-size: 39px;
    }

    .otp-top-box h3 {
        margin: 0;
        color: var(--text);
        font-size: 22px;
        font-weight: 950;
    }

    .otp-top-box p {
        margin: 7px 0 0;
        color: var(--muted);
        font-size: 13px;
        font-weight: 800;
    }

    .otp-top-box strong {
        color: var(--primary);
    }

    .otp-input-row input {
        text-align: center;
        letter-spacing: 8px;
        font-size: 20px;
        font-weight: 950;
    }

    .auth-link-btn {
        width: 100%;
        border: 0;
        background: transparent;
        color: var(--primary);
        font-size: 13px;
        font-weight: 950;
        margin-top: 12px;
        cursor: pointer;
    }

    .debug-otp-text {
        margin: 12px 0 0;
        padding: 10px 12px;
        background: #fff7ed;
        border: 1px solid #fed7aa;
        color: #9a3412;
        border-radius: 14px;
        font-size: 13px;
        font-weight: 900;
        text-align: center;
    }

    /* Final Register OTP UI Polish */
    #registerOtpStep {
        animation: otpStepIn 0.22s ease-out;
    }

    @keyframes otpStepIn {
        from {
            opacity: 0;
            transform: translateY(8px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .otp-top-box {
        text-align: center;
        padding: 6px 8px 20px;
    }

    .otp-icon-wrap {
        width: 84px;
        height: 84px;
        margin: 0 auto 15px;
        border-radius: 30px;
        background: linear-gradient(135deg, rgba(220, 38, 38, 0.10), rgba(220, 38, 38, 0.18));
        color: var(--primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .otp-icon-wrap ion-icon {
        font-size: 43px;
    }

    .otp-top-box h3 {
        margin: 0;
        color: var(--text);
        font-size: 25px;
        line-height: 1.1;
        font-weight: 950;
        letter-spacing: -0.5px;
    }

    .otp-top-box p {
        margin: 9px 0 0;
        color: var(--muted);
        font-size: 14px;
        font-weight: 850;
    }

    .otp-top-box strong {
        color: var(--primary);
        font-weight: 950;
    }

    .otp-input-row {
        min-height: 66px;
        border-radius: 23px !important;
    }

    .otp-input-row ion-icon {
        font-size: 25px;
    }

    .otp-input-row input {
        text-align: center;
        letter-spacing: 9px;
        font-size: 24px;
        font-weight: 950;
        color: var(--text);
    }

    #verifyOtpBtn {
        margin-top: 22px;
    }

    .auth-link-btn {
        width: 100%;
        min-height: 38px;
        border: 0;
        background: transparent;
        color: var(--primary);
        font-size: 13px;
        font-weight: 950;
        margin-top: 8px;
        cursor: pointer;
    }

    #backToDetailsBtn {
        margin-top: 14px;
    }

    #resendOtpBtn:disabled {
        color: #94a3b8;
        cursor: not-allowed;
    }

    .debug-otp-text {
        margin: 14px 0 0;
        padding: 12px 14px;
        background: #fff7ed;
        border: 1px solid #fed7aa;
        color: #9a3412;
        border-radius: 16px;
        font-size: 13px;
        font-weight: 950;
        text-align: center;
    }
}
/* ===== GLOBAL FONT FAMILY ===== */

html,
body,
button,
input,
textarea,
select,
a,
p,
span,
strong,
small,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
.auth-brand-header,
.auth-brand-header * {
    box-sizing: border-box !important;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.auth-brand-header {
    width: 100% !important;
    min-height: 76px !important;
    margin: -2px 0 18px !important;
    padding: 12px 14px !important;
    border-radius: 24px !important;
    background:
        radial-gradient(circle at 0% 0%, rgba(220, 38, 38, 0.10), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #fffafa 100%) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    position: relative !important;
    z-index: 10 !important;
}

.auth-brand-left {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.auth-brand-logo-wrap {
    width: 56px !important;
    height: 56px !important;
    flex: 0 0 56px !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
    box-shadow: 0 12px 26px rgba(220, 38, 38, 0.12) !important;
}

.auth-brand-logo-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.auth-brand-text {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.auth-brand-text strong {
    margin: 0 !important;
    color: #e11d20 !important;
    font-size: 20px !important;
    line-height: 1.12 !important;
    font-weight: 800 !important;
    letter-spacing: -0.45px !important;
    white-space: nowrap !important;
}

.auth-brand-text small {
    margin-top: 4px !important;
    color: #111827 !important;
    font-size: 12.5px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

.auth-brand-home {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06) !important;
}

.auth-brand-home ion-icon {
    font-size: 22px !important;
}

@media (max-width: 380px) {
    .auth-brand-header {
        padding: 11px 12px !important;
        gap: 8px !important;
    }

    .auth-brand-logo-wrap {
        width: 50px !important;
        height: 50px !important;
        flex-basis: 50px !important;
    }

    .auth-brand-text strong {
        font-size: 17px !important;
    }

    .auth-brand-text small {
        font-size: 11px !important;
    }
}