/**
 * Profile phone OTP verification modal — aligned with profile-form styling.
 */

.profile-phone-verify-modal {
    position: fixed;
    inset: 0;
    z-index: 10300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--color-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: pf-modal-fade-in 0.25s ease;
}

.profile-phone-verify-modal__content {
    position: relative;
    width: min(100%, 420px);
    max-height: min(92vh, 640px);
    overflow: auto;
    border-radius: 20px;
    background: var(--color-surface-raised);
    box-shadow: var(--shadow-surface-lg);
    animation: pf-modal-slide-up 0.3s ease;
}

.profile-phone-verify-modal__close {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--color-control);
    color: var(--color-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.profile-phone-verify-modal__close:hover {
    background: var(--color-control-hover);
    color: var(--color-text);
}

.profile-phone-verify-modal__header {
    padding: 2rem 1.5rem 1rem;
    text-align: center;
    background: var(--color-surface-muted);
    border-radius: 20px 20px 0 0;
}

.profile-phone-verify-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 0.875rem;
    border-radius: 16px;
    background: var(--color-control);
    color: var(--color-text);
    font-size: 24px;
}

.profile-phone-verify-modal__title {
    margin: 0 0 0.375rem;
    font-family: -apple-system, blinkmacsystemfont, "SF Pro Display", system-ui, sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.profile-phone-verify-modal__subtitle {
    margin: 0;
    font-family: -apple-system, blinkmacsystemfont, "SF Pro Text", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.profile-phone-verify-modal__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem 1.5rem;
}

.profile-phone-verify-modal__code {
    width: 100%;
    margin: 0;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 12px;
    background: var(--color-control);
    color: var(--color-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-align: center;
    box-shadow: inset 0 0 0 1px var(--color-border-subtle);
}

.profile-phone-verify-modal__code:focus {
    outline: none;
    background: var(--color-surface-raised);
    box-shadow:
        inset 0 0 0 1px rgba(60, 60, 67, 0.28),
        0 0 0 3px rgba(60, 60, 67, 0.08);
}

.profile-phone-verify-modal__error {
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    background: rgba(255, 59, 48, 0.1);
    color: #b42318;
    font-size: 13px;
    line-height: 1.4;
}

.profile-phone-verify-modal__primary,
.profile-phone-verify-modal__secondary {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 980px;
    font-family: -apple-system, blinkmacsystemfont, "SF Pro Text", system-ui, sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
}

.profile-phone-verify-modal__primary {
    background: var(--color-text);
    color: var(--color-text-inverse);
}

.profile-phone-verify-modal__primary:hover:not(:disabled) {
    background: #2c2c2e;
}

.profile-phone-verify-modal__secondary {
    background: var(--color-control);
    color: var(--color-text);
}

.profile-phone-verify-modal__secondary:hover:not(:disabled) {
    background: var(--color-control-hover);
}

.profile-phone-verify-modal__primary:disabled,
.profile-phone-verify-modal__secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.profile-phone-verify-modal__status {
    margin: 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-text-muted);
}

body.profile-phone-verify-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .profile-phone-verify-modal {
        align-items: flex-end;
        padding: 0;
    }

    .profile-phone-verify-modal__content {
        width: 100%;
        max-height: min(88vh, 720px);
        border-radius: 18px 18px 0 0;
    }

    .profile-phone-verify-modal__header {
        border-radius: 18px 18px 0 0;
    }

    .profile-phone-verify-modal__code {
        font-size: 24px;
    }
}
