.card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    padding: 44px 38px 36px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
    color: #f2f5f7;
    text-align: center;
}

.card h2 {
    font-size: 21px;
    font-weight: 700;
    margin: 0 0 6px;
}

.card .sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 26px;
    font-weight: 400;
}

.error-box {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 180, 180, 0.6);
    color: #fff;
    font-size: 12.5px;
    padding: 9px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    text-align: right;
}

.field {
    margin-bottom: 16px;
    text-align: right;
}

.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 7px;
}

.input-wrap {
    position: relative;
}

.field input {
    width: 100%;
    padding: 13px 16px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: inherit;
    font-size: 14px;
    color: #fff;
    outline: none;
    transition: border-color .18s ease, background .18s ease;
}

.field input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.field input:focus {
    border-color: var(--teal-light);
    background: rgba(255, 255, 255, 0.14);
}

.field.password input {
    padding-left: 44px;
}

#toggle-password,
.toggle-password {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
}

#toggle-password:hover,
.toggle-password:hover {
    color: #fff;
}

.row-between {
    display: flex;
    justify-content: flex-start;
    margin: 2px 0 22px;
}

.row-between a {
    font-size: 12px;
    color: var(--teal-light);
    text-decoration: none;
}

.row-between a:hover {
    color: #fff;
    text-decoration: underline;
}

button.submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 13px;
    background: var(--teal-light);
    color: var(--deep);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.5);
    transition: transform .15s ease, opacity .15s ease;
}

button.submit:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.foot {
    text-align: center;
    margin-top: 22px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.75);
}

.foot a {
    color: var(--teal-light);
    font-weight: 700;
    text-decoration: none;
}

.foot a:hover {
    text-decoration: underline;
}

.card-wide {
    max-width: 460px;
    max-height: calc(100% - 48px);
    max-height: calc(100vh - 48px);
    padding: 22px 30px 20px;
    overflow-y: auto;
}

.card-wide h2 {
    font-size: 18px;
    margin-bottom: 3px;
}

.card-wide .sub {
    font-size: 12px;
    margin-bottom: 14px;
}

.card-wide .field {
    margin-bottom: 9px;
}

.card-wide .field label {
    font-size: 11.5px;
    margin-bottom: 4px;
}

.card-wide .field input {
    padding: 9px 14px;
    font-size: 13px;
}

.card-wide .field.password input {
    padding-left: 38px;
}

.card-wide .radio-group {
    gap: 14px;
}

.card-wide .radio-item {
    font-size: 12px;
}

.card-wide button.submit {
    padding: 11px;
    font-size: 14px;
    margin-top: 4px;
}

.card-wide .foot {
    margin-top: 12px;
    font-size: 11.5px;
}

.card-wide .prefix-badge {
    padding: 9px 12px;
    font-size: 12px;
}

.radio-group {
    display: flex;
    gap: 18px;
    justify-content: flex-end;
}

.radio-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.radio-item input[type="radio"] {
    accent-color: var(--teal);
    width: 16px;
    height: 16px;
}

.mobile-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-wrap input {
    flex: 1;
}

.prefix-badge {
    padding: 12px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
}

.field-error {
    margin: 6px 2px 0;
    font-size: 12px;
    color: var(--danger);
    text-align: right;
}

.verify-box {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    text-align: right;
}

.verify-box .input-wrap {
    margin-bottom: 10px;
}

.submit-secondary {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.success-msg {
    margin-top: 16px;
    font-size: 13px;
    color: #fff;
    text-align: center;
}

.success-msg a {
    display: inline-block;
    margin-top: 8px;
    color: #fff;
    font-weight: 700;
}

@media (max-width: 720px) {
    .card {
        width: 100%;
        max-width: none;
        padding: 30px 20px 24px;
        border-radius: 18px;
    }

    .card h2 {
        font-size: 18px;
    }

    .card .sub {
        font-size: 12px;
        margin-bottom: 20px;
    }

    .field {
        margin-bottom: 13px;
    }

    .field label {
        font-size: 11.5px;
        margin-bottom: 5px;
    }

    .field input {
        padding: 11px 14px;
        font-size: 13.5px;
        border-radius: 11px;
    }

    .field.password input {
        padding-left: 38px;
    }

    button.submit {
        padding: 12px;
        font-size: 14px;
        border-radius: 11px;
    }

    .row-between a {
        font-size: 11.5px;
    }

    .foot {
        font-size: 11.5px;
        margin-top: 18px;
    }

    .radio-group {
        gap: 12px;
    }

    .radio-item {
        font-size: 12px;
    }

    .prefix-badge {
        padding: 10px 10px;
        font-size: 12px;
    }

    .error-box {
        font-size: 12px;
        padding: 8px 12px;
    }

    .field-error {
        font-size: 11px;
    }

    .card-wide {
        min-height: calc(60vh - 32px);
        max-height: calc(80vh - 32px);
        padding: 20px 18px 18px;
    }
}

@media (max-width: 380px) {
    .card {
        padding: 24px 16px 20px;
    }

    .field input {
        padding: 10px 12px;
        font-size: 13px;
    }

    button.submit {
        font-size: 13.5px;
    }
}

.waiting-box {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    color: #f2f5f7;
    font-size: 13.5px;
    box-shadow: 0 14px 28px -12px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

.waiting-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--teal-light);
    border-radius: 50%;
    animation: waiting-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.waiting-box.stopped .waiting-spinner {
    display: none;
}

.waiting-box.rejected {
    border-color: var(--danger);
}

@keyframes waiting-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 720px) {
    .waiting-box {
        bottom: 20px;
        font-size: 12.5px;
        padding: 12px 18px;
    }
}

/* ===== سازگاری با مرورگرهای قدیمی ===== */
@supports (height: 100dvh) {
    .card-wide {
        max-height: calc(100dvh - 48px);
    }
}

@supports not (aspect-ratio: 1 / 1) {

    html .radio-group,
    html .radio-item,
    html .mobile-wrap,
    html .waiting-box {
        gap: 0 !important;
    }

    html .radio-group>* {
        margin-left: 18px;
    }

    html .card-wide .radio-group>* {
        margin-left: 14px;
    }

    html .radio-item>* {
        margin-left: 6px;
    }

    html .mobile-wrap>* {
        margin-left: 8px;
    }

    html .waiting-box>* {
        margin-left: 12px;
    }

    html .radio-group>*:last-child,
    html .radio-item>*:last-child,
    html .mobile-wrap>*:last-child,
    html .waiting-box>*:last-child {
        margin-left: 0;
    }
}

@supports not (aspect-ratio: 1 / 1) {
    @media (max-width: 720px) {
        html .radio-group>* {
            margin-left: 12px;
        }

        html .radio-group>*:last-child {
            margin-left: 0;
        }
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {

    .card,
    .waiting-box {
        background: rgba(20, 28, 46, 0.85);
    }
}
