/* Shared Auth UI — Login, OTP, Register funnel, Logout. Loaded by _LayoutAuth.cshtml.
   Fonts copied from assets/css/main.css so auth can load without that global file. */

@font-face {
    font-family: 'vazir-fd-wl';
    src: url('../assets/fonts/vazir/vazir-fd-wl.ttf') format('truetype');
}

@font-face {
    font-family: 'vazir-bold-fd-wl';
    src: url('../assets/fonts/vazir/vazir-bold-fd-wl.ttf') format('truetype');
}

:root {
    --auth-orange: #f47b3b;
    --auth-orange-deep: #ed5d43;
    --auth-orange-light: #ff9b3d;
    --auth-ink: #263244;
    --auth-muted: #768195;
    --auth-label: #4a5668;
    --auth-border: #e5eaf1;
    --auth-card-radius: 24px;
    --auth-control-radius: 14px;
    --auth-control-height: 56px;
}

body.auth-page {
    margin: 0;
    overflow-x: hidden;
    font-family: vazir-fd-wl, Tahoma, sans-serif;
    font-size: 16px;
    color: #515151;
    background-color: #f7f1eb;
}

body.auth-page a {
    text-decoration: none;
}

.auth-shell,
.auth-shell * {
    box-sizing: border-box;
}

.auth-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100dvh;
    padding: 32px 16px 40px;
    overflow-x: hidden;
    background-color: #f7f1eb;
    background-image:
        radial-gradient(ellipse 90% 52% at 50% -10%, rgba(255, 155, 61, 0.26), transparent 58%),
        radial-gradient(ellipse 46% 38% at 110% 100%, rgba(237, 93, 67, 0.13), transparent 55%),
        radial-gradient(ellipse 42% 34% at -10% 82%, rgba(244, 123, 59, 0.11), transparent 52%),
        linear-gradient(165deg, #fff8f2 0%, #f6efe8 48%, #efe6de 100%);
}

.auth-brand,
.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-brand {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.auth-logo-link {
    display: inline-block;
    color: inherit;
    text-decoration: none;
    line-height: 0;
}

.auth-logo-link:hover,
.auth-logo-link:focus {
    color: inherit;
    text-decoration: none;
}

.auth-home {
    margin: 18px 0 0;
    text-align: center;
}

.auth-home__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 6px 12px;
    color: var(--auth-muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-home__link:hover,
.auth-home__link:focus {
    color: var(--auth-orange-deep);
    text-decoration: none;
}

.auth-logo-wrap {
    position: relative;
    display: inline-flex;
    animation: auth-logo-enter 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-logo-wrap::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 0;
    width: 92px;
    height: 22px;
    pointer-events: none;
    background: radial-gradient(ellipse, rgba(244, 123, 59, 0.34) 0%, rgba(237, 93, 67, 0.1) 48%, transparent 72%);
    filter: blur(9px);
    transform: translateX(-50%);
}

.auth-logo-shine {
    position: relative;
    z-index: 1;
    display: block;
    overflow: hidden;
    animation: auth-logo-float 6.4s ease-in-out 0.8s infinite;
}

.auth-logo-shine::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
        108deg,
        transparent 38%,
        rgba(255, 255, 255, 0.18) 46%,
        rgba(255, 255, 255, 0.55) 50%,
        rgba(255, 255, 255, 0.18) 54%,
        transparent 62%
    );
    opacity: 0;
    transform: translateX(-130%) skewX(-14deg);
    animation: auth-logo-shine 7.2s ease-in-out 1.6s infinite;
}

.auth-logo {
    display: block;
    width: 140px;
    max-width: 100%;
    height: auto;
}

.auth-card {
    width: 100%;
    max-width: 100%;
    padding: 38px 30px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: var(--auth-card-radius);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.82) inset,
        0 10px 28px rgba(38, 50, 68, 0.07);
    backdrop-filter: blur(18px) saturate(155%);
    -webkit-backdrop-filter: blur(18px) saturate(155%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .auth-card {
        background: rgba(255, 255, 255, 0.94);
    }
}

.auth-icon,
.otp-icon {
    display: grid;
    width: 66px;
    height: 66px;
    margin: 0 auto 18px;
    color: #fff;
    font-size: 28px;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--auth-orange-light), var(--auth-orange-deep));
}

.auth-title,
.otp-title {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    color: var(--auth-ink);
}

.auth-description,
.otp-description {
    margin: 0 0 28px;
    color: var(--auth-muted);
    line-height: 2;
    text-align: center;
}

.auth-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--auth-label);
}

.auth-input,
.otp-input {
    width: 100%;
    max-width: 100%;
    height: var(--auth-control-height);
    padding: 0 16px;
    direction: ltr;
    font-size: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.86);
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-control-radius);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.otp-input {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.42em;
}

.auth-input:focus,
.otp-input:focus {
    border-color: var(--auth-orange);
    box-shadow: 0 0 0 4px rgba(244, 123, 59, 0.12);
}

.auth-button,
.otp-button {
    width: 100%;
    max-width: 100%;
    min-height: var(--auth-control-height);
    margin-top: 20px;
    padding: 15px;
    color: #fff;
    font-weight: 800;
    border: 0;
    border-radius: var(--auth-control-radius);
    background: linear-gradient(135deg, var(--auth-orange), var(--auth-orange-deep));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-button:hover,
.otp-button:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(237, 93, 67, 0.26);
}

.auth-terms {
    margin: 22px 0 0;
    color: #7a8494;
    font-size: 0.85rem;
    line-height: 2;
    text-align: center;
}

.auth-terms a {
    color: #e9673f;
    font-weight: 700;
}

.otp-content {
    text-align: center;
}

.otp-status {
    min-height: 25px;
    margin: 16px 0 4px;
    color: #778295;
    font-size: 0.88rem;
    text-align: center;
}

.resend-button {
    padding: 8px 14px;
    color: #e9673f;
    font-weight: 700;
    background: transparent;
    border: 0;
}

@keyframes auth-logo-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-logo-float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes auth-logo-shine {
    0%,
    64% {
        opacity: 0;
        transform: translateX(-130%) skewX(-14deg);
    }

    70% {
        opacity: 0.85;
    }

    82% {
        opacity: 0;
        transform: translateX(130%) skewX(-14deg);
    }

    100% {
        opacity: 0;
        transform: translateX(130%) skewX(-14deg);
    }
}

@media (max-width: 767px) {
    .auth-logo {
        width: 110px;
    }
}

@media (max-width: 430px) {
    .auth-shell {
        padding: 24px 16px 32px;
    }

    .auth-brand {
        margin-bottom: 18px;
    }

    .auth-logo {
        width: 96px;
    }

    .auth-card {
        padding: 28px 18px;
    }

    .auth-icon,
    .otp-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 14px;
        font-size: 24px;
        border-radius: 16px;
    }

    .auth-title,
    .otp-title {
        font-size: 1.22rem;
    }

    .auth-input,
    .otp-input,
    .auth-button,
    .otp-button {
        height: 52px;
        min-height: 52px;
    }
}

@media (max-width: 374px) {
    .auth-logo {
        width: 88px;
    }

    .auth-card {
        padding: 24px 16px;
    }

    .otp-input {
        font-size: 1.28rem;
        letter-spacing: 0.32em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-logo-wrap,
    .auth-logo-shine,
    .auth-logo-shine::after,
    .auth-button,
    .otp-button {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .auth-button:hover,
    .otp-button:hover {
        transform: none;
    }
}

/* Register / Bank / Business Type / Logout — scoped extras. Do not change Login/OTP rules above. */

.auth-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 18px;
    color: var(--auth-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.auth-nav a {
    color: #e9673f;
}

.auth-nav-sep {
    color: var(--auth-border);
}

.auth-row {
    margin-bottom: 14px;
}

.auth-row .text-danger,
.auth-license-message {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
}

.auth-input.auth-field {
    direction: inherit;
    text-align: start;
}

.auth-select {
    width: 100%;
    max-width: 100%;
    height: var(--auth-control-height);
    padding: 0 16px;
    direction: inherit;
    font-size: 1rem;
    text-align: start;
    color: var(--auth-ink);
    background: rgba(255, 255, 255, 0.86);
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-control-radius);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-select:focus {
    border-color: var(--auth-orange);
    box-shadow: 0 0 0 4px rgba(244, 123, 59, 0.12);
}

.auth-shaba {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-shaba .auth-input {
    flex: 1;
    min-width: 0;
}

.auth-shaba-prefix {
    flex: 0 0 auto;
    color: var(--auth-ink);
    font-weight: 800;
}

.auth-skip {
    display: block;
    margin: 4px 0 0;
    color: #e9673f;
    font-weight: 700;
    text-align: center;
}

.auth-actions {
    margin-top: 8px;
}

.auth-actions .auth-button {
    margin-top: 12px;
}

.auth-button-secondary {
    color: var(--auth-orange-deep);
    background: rgba(255, 255, 255, 0.86);
    border: 2px solid var(--auth-border);
}

.auth-button-secondary:hover {
    color: var(--auth-orange-deep);
    border-color: var(--auth-orange);
    box-shadow: 0 10px 22px rgba(237, 93, 67, 0.12);
}

.visuallyhidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0 0 0 0);
}

.auth-card .auth-plans {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin: 0 0 20px;
}

.auth-card .auth-plans .plan {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.auth-card .auth-plans .plan input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.auth-card .auth-plans .plan.complete-plan {
    margin-top: 0;
}

.auth-card .auth-plans .plan .plan-content {
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.86);
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-control-radius);
}

.auth-card .auth-plans .plan .plan-content img {
    height: 48px;
    margin-left: 16px;
}

.auth-card .auth-plans .plan .plan-details span {
    margin-bottom: 0;
    color: var(--auth-ink);
    font-size: 1rem;
    font-weight: 700;
}

.auth-card .auth-plans .plan input[type="radio"]:checked + .plan-content {
    background: rgba(244, 123, 59, 0.08);
    border: 2px solid var(--auth-orange);
}

.auth-card .auth-plans .plan input[type="radio"]:checked + .plan-content:after {
    content: "";
    position: absolute;
    top: 20px;
    right: 20px;
    width: 15px;
    height: 15px;
    border: 3px solid #fff;
    border-radius: 100%;
    background: linear-gradient(135deg, var(--auth-orange), var(--auth-orange-deep));
}

.auth-license form + form {
    margin-top: 12px;
}

.auth-license .auth-button {
    margin-top: 12px;
}

.auth-license-message {
    color: #2e7d4f;
    text-align: center;
    line-height: 2;
}

.auth-license-preview {
    margin-top: 20px;
    text-align: center;
}

.auth-license-preview img {
    width: 100%;
    max-width: 220px;
    height: auto;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-control-radius);
}

@media (max-width: 430px) {
    .auth-select {
        height: 52px;
    }

    .auth-card .auth-plans .plan .plan-content {
        padding: 14px;
    }
}
