.amazon-sms-modal-open {
    overflow: hidden;
}

.amazon-sms-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    isolation: isolate;
}

.amazon-sms-modal[hidden] {
    display: none !important;
}

.amazon-sms-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.amazon-sms-modal__panel {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    max-height: min(90vh, 680px);
    display: flex;
    flex-direction: column;
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.amazon-sms-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}

.amazon-sms-modal__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.amazon-auth-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.amazon-auth-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.amazon-auth-panel__head {
    flex-shrink: 0;
    padding: 24px 24px 0;
    padding-right: 48px;
}

.amazon-auth-panel__body {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 24px 8px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.amazon-auth-panel__foot {
    flex-shrink: 0;
    padding: 8px 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #1e293b;
}

.amazon-sms-modal__title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
}

.amazon-sms-modal__hint {
    margin: 0 0 12px;
    font-size: 0.8125rem;
    color: #94a3b8;
    line-height: 1.45;
}

.amazon-sms-form-row--2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.amazon-sms-form-row--2 .amazon-sms-field {
    margin-bottom: 0;
    min-width: 0;
}

@media (max-width: 380px) {
    .amazon-sms-form-row--2 {
        grid-template-columns: 1fr;
    }
}

.amazon-sms-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.amazon-sms-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #0f172a;
    color: #fff;
    font-size: 1rem;
}

.amazon-sms-field input:focus {
    outline: none;
    border-color: #6366f1;
}

.amazon-sms-field--error span {
    color: #fca5a5;
}

.amazon-sms-field--error input {
    border-color: #f87171;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35);
}

.amazon-sms-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 14px;
}

.amazon-sms-field--grow {
    flex: 1;
    margin-bottom: 0;
}

.amazon-sms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.amazon-sms-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.amazon-sms-btn--primary {
    width: 100%;
    margin-top: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.amazon-sms-btn--primary:hover:not(:disabled) {
    filter: brightness(1.05);
}

.amazon-sms-btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    align-self: flex-end;
    height: 44px;
    padding: 0 12px;
    margin-bottom: 0;
    font-size: 0.8rem;
}

#amazon-auth-panel-register .amazon-sms-row {
    margin-bottom: 0;
}

.amazon-sms-message {
    min-height: 1.25em;
    font-size: 0.85rem;
    margin: 0 0 10px;
    color: #86efac;
}

.amazon-sms-message.is-error {
    color: #fca5a5;
}

.amazon-auth-panel[hidden] {
    display: none !important;
}

.amazon-sms-modal__panel > .amazon-auth-panel:not([hidden]) {
    flex: 1;
    min-height: 0;
}

.amazon-auth-switch {
    margin: 12px 0 0;
    text-align: center;
}

.amazon-auth-switch__btn {
    background: none;
    border: none;
    color: #a5b4fc;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
}

.amazon-auth-switch__btn:hover {
    color: #c7d2fe;
}

.amazon-auth-forgot {
    margin: -6px 0 12px;
    text-align: right;
}

.amazon-auth-forgot__link {
    color: #94a3b8;
    font-size: 0.8125rem;
    text-decoration: none;
}

.amazon-auth-forgot__link:hover {
    color: #c7d2fe;
    text-decoration: underline;
}

.amazon-sms-captcha {
    margin-bottom: 14px;
}

.amazon-sms-row--captcha {
    align-items: flex-end;
    margin-bottom: 0;
}

.amazon-sms-field--captcha {
    margin-bottom: 0;
}

.amazon-sms-captcha__inline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.amazon-sms-field--captcha input {
    flex: 1 1 72px;
    min-width: 64px;
    max-width: 120px;
}

.amazon-sms-captcha__img {
    display: block;
    width: 100px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    cursor: pointer;
}

.amazon-sms-row--captcha .amazon-sms-captcha__refresh {
    height: 44px;
    align-self: flex-end;
    flex-shrink: 0;
    white-space: nowrap;
}

.amazon-sms-captcha__verify {
    width: 100%;
    margin-bottom: 8px;
}

.amazon-sms-captcha__status {
    margin: 0 0 10px;
    font-size: 0.8rem;
    min-height: 1.2em;
    color: #94a3b8;
}

.amazon-sms-captcha__status.is-ok {
    color: #86efac;
}

.amazon-sms-captcha__status.is-error {
    color: #fca5a5;
}

.amazon-sms-btn--ghost {
    background: transparent;
    color: #94a3b8;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.amazon-sms-btn--ghost:hover {
    color: #e2e8f0;
}
