/* Sign-in methods modal: add an email / phone number to the account, merge accounts. */
.sim-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 17, 27, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sim-overlay.sim-open {
    display: flex;
}

.sim-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #fff;
    color: #222;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    padding: 28px 24px 24px;
    font-family: var(--app-font-family, 'Poppins', sans-serif);
    animation: sim-rise 0.22s ease;
}

@keyframes sim-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.sim-close {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f2f3f5;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sim-close:hover {
    background: #e6e8eb;
    color: #222;
}

.sim-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 36px 6px 0;
    line-height: 1.3;
}

html[dir="rtl"] .sim-title {
    margin: 0 0 6px 36px;
}

.sim-text {
    font-size: 14px;
    color: #666;
    margin: 0 0 18px;
    line-height: 1.5;
}

.sim-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.sim-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    background: #fafbfc;
}

.sim-row-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #888;
    margin-bottom: 2px;
}

.sim-row-value {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    word-break: break-all;
}

.sim-row-value.sim-muted {
    color: #999;
    font-weight: 500;
}

.sim-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(40, 167, 69, 0.12);
    color: #1e7e34;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.sim-btn {
    border: none;
    border-radius: 999px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.sim-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sim-btn-primary {
    width: 100%;
    color: #fff;
    background: linear-gradient(45deg, #E1306C 0%, #C13584 25%, #833AB4 50%);
}

.sim-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(225, 48, 108, 0.35);
}

.sim-btn-small {
    padding: 8px 16px;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(45deg, #E1306C 0%, #C13584 25%, #833AB4 50%);
    white-space: nowrap;
}

.sim-btn-link {
    background: none;
    color: #666;
    padding: 8px 4px;
    font-weight: 500;
}

.sim-btn-link:hover:not(:disabled) {
    color: #E1306C;
}

.sim-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    padding: 0;
    border: none;
    background: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.sim-back svg {
    width: 16px;
    height: 16px;
}

html[dir="rtl"] .sim-back svg {
    transform: scaleX(-1);
}

.sim-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #dbdbdb;
    border-radius: 14px;
    font-size: 16px;
    font-family: inherit;
    color: #222;
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease;
}

.sim-input:focus {
    border-color: #C13584;
}

.sim-phone-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.sim-phone-wrap select {
    flex: 0 0 auto;
    max-width: 130px;
    padding: 13px 10px;
    border: 1.5px solid #dbdbdb;
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: #222;
}

.sim-phone-wrap .sim-input {
    direction: ltr;
}

.sim-field {
    margin-bottom: 14px;
}

.sim-digits {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 18px 0 14px;
    direction: ltr;
}

.sim-digit {
    width: 46px;
    height: 54px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 1.5px solid #dbdbdb;
    border-radius: 12px;
    background: #fff;
    color: #222;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sim-digit:focus {
    border-color: #C13584;
    box-shadow: 0 0 0 3px rgba(193, 53, 132, 0.15);
}

.sim-digit.sim-error-field {
    border-color: #ff3b30;
}

.sim-error {
    min-height: 20px;
    margin: 6px 0 10px;
    color: #ff3b30;
    font-size: 13px;
    line-height: 1.4;
}

.sim-status {
    margin: 6px 0 10px;
    color: #666;
    font-size: 13px;
    text-align: center;
}

.sim-resend {
    text-align: center;
    margin-top: 4px;
}

.sim-accounts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.sim-account {
    border: 1.5px solid #e9ecef;
    border-radius: 16px;
    padding: 14px 16px;
}

.sim-account.sim-account-current {
    border-color: rgba(193, 53, 132, 0.45);
    background: rgba(193, 53, 132, 0.04);
}

.sim-account-title {
    font-size: 13px;
    font-weight: 700;
    color: #C13584;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

.sim-account-line {
    font-size: 14px;
    color: #333;
    margin: 3px 0;
    word-break: break-all;
}

.sim-account-line.sim-muted {
    color: #888;
    font-size: 13px;
}

.sim-account .sim-btn {
    margin-top: 12px;
}

.sim-reasons {
    margin-top: 10px;
    font-size: 12.5px;
    color: #a94442;
    line-height: 1.45;
}

.sim-reasons ul {
    margin: 4px 0 0 18px;
    padding: 0;
}

html[dir="rtl"] .sim-reasons ul {
    margin: 4px 18px 0 0;
}

.sim-summary {
    background: #fafbfc;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #333;
}

.sim-summary div {
    margin: 4px 0;
}

.sim-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #333;
    margin: 0 0 14px;
    cursor: pointer;
    line-height: 1.45;
}

.sim-check input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: #C13584;
}

.sim-done-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 4px auto 16px;
    background: linear-gradient(45deg, #20B040, #28a745);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sim-done-icon svg {
    width: 28px;
    height: 28px;
}

.sim-center {
    text-align: center;
}

.sim-spinner {
    width: 32px;
    height: 32px;
    margin: 24px auto;
    border: 3px solid #eee;
    border-top-color: #C13584;
    border-radius: 50%;
    animation: sim-spin 0.8s linear infinite;
}

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

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

    .sim-card {
        max-width: none;
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
        padding: 26px 20px 28px;
    }

    .sim-digit {
        width: 42px;
        height: 50px;
        font-size: 22px;
    }
}
