.fp-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fp-modal[hidden] {
    display: none;
}

body.fp-open {
    overflow: hidden;
}

.fp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .55);
    backdrop-filter: blur(3px);
    animation: fp-fade .2s ease;
}

.fp-dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 30px 28px 26px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 30px 60px -20px rgba(17, 24, 39, .35);
    text-align: center;
    animation: fp-pop .28s var(--auth-ease, ease);
}

.fp-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--auth-bg-soft, #f7f8fa);
    color: var(--auth-text-muted, #6b7280);
    font-size: 15px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.fp-close:hover {
    background: var(--auth-brand-light, #fff5f0);
    color: var(--auth-brand, #ef5526);
}

.fp-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: var(--auth-brand-light, #fff5f0);
    color: var(--auth-brand, #ef5526);
    font-size: 24px;
    transition: background .2s ease, color .2s ease;
}

.fp-modal.is-done .fp-icon {
    background: #ecfdf3;
    color: #16a34a;
}

.fp-title {
    margin: 0 0 6px;
    color: var(--auth-text, #1f2937);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.fp-subtitle {
    max-width: 330px;
    margin: 0 auto 18px;
    color: var(--auth-text-muted, #6b7280);
    font-size: 13.5px;
    line-height: 1.55;
}

.fp-subtitle b {
    color: var(--auth-text, #1f2937);
}

.fp-progress {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.fp-progress li {
    width: 28px;
    height: 5px;
    border-radius: 999px;
    background: var(--auth-border, #e5e7eb);
    transition: width .2s ease, background .2s ease;
}

.fp-progress li.is-done {
    background: #fbb79f;
}

.fp-progress li.is-active {
    width: 40px;
    background: var(--auth-brand, #ef5526);
}

.fp-modal.is-done .fp-progress {
    display: none;
}

.fp-alert {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
}

.fp-alert[hidden] {
    display: none;
}

.fp-alert.is-info {
    background: #ecfdf3;
    color: #15803d;
}

.fp-step {
    display: none;
    text-align: left;
}

.fp-step.is-active {
    display: block;
    animation: fp-slide .25s var(--auth-ease, ease);
}

.fp-label {
    display: block;
    margin: 0 0 6px;
    color: var(--auth-text, #1f2937);
    font-size: 13px;
    font-weight: 600;
}

.fp-input {
    position: relative;
    margin-bottom: 14px;
}

.fp-input > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 13px;
    pointer-events: none;
    transition: color .15s ease;
}

.fp-input:focus-within > i {
    color: var(--auth-brand, #ef5526);
}

.fp-input input {
    width: 100%;
    height: 46px;
    padding: 0 44px 0 40px;
    border: 1px solid var(--auth-border, #e5e7eb);
    border-radius: 10px;
    background: #ffffff;
    color: var(--auth-text, #1f2937);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.fp-input input::placeholder {
    color: #9ca3af;
}

.fp-input input:hover {
    border-color: #d1d5db;
}

.fp-input input:focus {
    border-color: var(--auth-brand, #ef5526);
    box-shadow: 0 0 0 3px rgba(239, 85, 38, .12);
}

.fp-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    transition: color .15s ease;
}

.fp-eye:hover {
    color: var(--auth-brand, #ef5526);
}

.fp-code {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 4px 0 18px;
}

.fp-code input {
    width: 52px;
    height: 60px;
    padding: 0;
    border: 1.5px solid var(--auth-border, #e5e7eb);
    border-radius: 14px;
    background: var(--auth-bg-soft, #f7f8fa);
    color: var(--auth-text, #1f2937);
    font-family: inherit;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    caret-color: var(--auth-brand, #ef5526);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .15s ease;
}

.fp-code input.is-filled {
    border-color: #fbb79f;
    background: #ffffff;
}

.fp-code input:focus {
    border-color: var(--auth-brand, #ef5526);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(239, 85, 38, .12);
    transform: translateY(-1px);
}

.fp-code.is-error input {
    border-color: #ef4444;
    animation: fp-shake .35s ease;
}

.fp-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.fp-link {
    padding: 0;
    border: none;
    background: none;
    color: var(--auth-brand, #ef5526);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.fp-link:hover:not(:disabled) {
    color: var(--auth-brand-dark, #d8451f);
    text-decoration: underline;
}

.fp-link:disabled {
    color: #9ca3af;
    cursor: default;
}

.fp-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin: 0 0 6px;
    padding: 0;
    list-style: none;
}

.fp-rules li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    font-size: 12.5px;
    font-weight: 600;
    transition: color .15s ease;
}

.fp-rules li i {
    font-size: 12px;
}

.fp-rules li.is-ok {
    color: #16a34a;
}

.fp-submit {
    margin-top: 10px;
}

@keyframes fp-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fp-pop {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to { opacity: 1; transform: none; }
}

@keyframes fp-slide {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes fp-sheet {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: none; }
}

@keyframes fp-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

@media (max-width: 480px) {
    .fp-modal {
        align-items: flex-end;
        padding: 0;
    }

    .fp-dialog {
        max-width: none;
        max-height: 92vh;
        padding: 26px 20px 24px;
        border-radius: 22px 22px 0 0;
        animation: fp-sheet .3s var(--auth-ease, ease);
    }

    .fp-code {
        gap: 8px;
    }

    .fp-code input {
        width: 48px;
        height: 56px;
        font-size: 24px;
    }

    .fp-rules {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fp-backdrop,
    .fp-dialog,
    .fp-step.is-active,
    .fp-code.is-error input {
        animation: none;
    }
}
