/* ورود سرویس‌کار وب‌اپ iOS — هم‌رنگ و هم‌سبک activity_login اپ اندروید (colors.xml) */
:root {
    --app-purple: #071bb0;
    --app-purple-dark: #061894;
    --app-orange: #ff6b35;
    --app-orange-dark: #e55a2b;
    --app-black: #1a1a2e;
    --app-error: #dc3545;
    --app-success: #28a745;
}

html.ios-sp-login-html,
body.ios-sp-login-body {
    height: 100%;
}

body.ios-sp-login-body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    background: #fff;
    color: var(--app-black);
    position: relative;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Safari iOS: font-size زیر 16px باعث زوم خودکار هنگام فوکوس می‌شود */
@supports (-webkit-touch-callout: none) {
    body.ios-sp-login-body input,
    body.ios-sp-login-body select,
    body.ios-sp-login-body textarea,
    body.ios-sp-register-body input,
    body.ios-sp-register-body select,
    body.ios-sp-register-body textarea {
        font-size: 16px !important;
    }
}

body.ios-sp-login-body .ios-sp-login-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body.ios-sp-login-body .ios-sp-login-orb--tr {
    width: 220px;
    height: 220px;
    top: -60px;
    left: -40px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.35) 0%, transparent 70%);
}

body.ios-sp-login-body .ios-sp-login-orb--bl {
    width: 180px;
    height: 180px;
    bottom: 40px;
    right: -50px;
    background: radial-gradient(circle, rgba(7, 27, 176, 0.28) 0%, transparent 70%);
}

.ios-sp-login-wrap {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 520px;
    margin: 0 auto;
}

.ios-sp-login-header {
    background: linear-gradient(330deg, #061894 0%, #071bb0 45%, #2D5AE8 100%);
    border-radius: 0 0 26px 26px;
    padding: 16px 18px 14px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    box-shadow: 0 8px 24px rgba(3, 8, 82, 0.22);
}

.ios-sp-login-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ios-sp-login-header-chip {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ios-sp-login-header-chip img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.ios-sp-login-header-text {
    flex: 1;
    min-width: 0;
}

.ios-sp-login-header-text h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
}

.ios-sp-login-header-text p {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.92);
}

.ios-sp-login-pro {
    font-size: 0.62rem;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
    padding: 4px 9px;
    border-radius: 8px;
    flex-shrink: 0;
}

.ios-sp-login-scroll {
    flex: 1;
    padding: 12px 20px 32px;
}

.ios-sp-login-logo-ring {
    position: relative;
    width: 132px;
    height: 132px;
    margin: 8px auto 12px;
}

.ios-sp-login-logo-ring::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(7, 27, 176, 0.2), rgba(255, 107, 53, 0.18));
    box-shadow: 0 12px 28px rgba(5, 16, 128, 0.12);
}

.ios-sp-login-logo-ring img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 116px;
    height: 116px;
    object-fit: contain;
}

.ios-sp-login-card {
    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(232, 228, 237, 0.9);
    box-shadow: 0 16px 40px rgba(5, 16, 128, 0.1);
    padding: 28px;
}

.ios-sp-login-card label.ios-sp-lbl {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(7, 27, 176, 0.55);
    margin-bottom: 6px;
    padding-inline-start: 4px;
}

.ios-sp-login-field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f8fb;
    border: 2px solid #e8e4ed;
    border-radius: 16px;
    padding: 11px 14px;
    margin-bottom: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ios-sp-login-field:focus-within {
    border-color: var(--app-purple);
    box-shadow: 0 0 0 4px rgba(7, 27, 176, 0.12);
}

.ios-sp-login-field.is-invalid {
    border-color: var(--app-error);
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.12);
}

.ios-sp-login-field .ios-sp-icon-chip {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(7, 27, 176, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--app-orange);
    font-size: 1rem;
}

.ios-sp-login-field input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--app-black);
    outline: none;
}

.ios-sp-login-field input::placeholder {
    color: rgba(108, 117, 125, 0.65);
}

.ios-sp-login-toggle {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
}

.ios-sp-login-btn-main {
    width: 100%;
    min-height: 52px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--app-orange) 0%, var(--app-orange-dark) 100%);
    box-shadow: 0 8px 20px rgba(229, 90, 43, 0.35);
    margin-bottom: 12px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.ios-sp-login-btn-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(229, 90, 43, 0.4);
}

.ios-sp-login-btn-main:disabled {
    opacity: 0.65;
    transform: none;
    cursor: not-allowed;
}

.ios-sp-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
}

.ios-sp-login-divider span {
    flex: 1;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.55), transparent);
}

.ios-sp-login-divider em {
    font-style: normal;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--app-orange);
}

.ios-sp-login-btn-outline {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    background: #fff;
    border: 2px solid var(--app-purple);
    color: var(--app-orange);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.ios-sp-login-btn-outline:hover {
    background: rgba(7, 27, 176, 0.06);
    color: var(--app-orange-dark);
}

.ios-sp-login-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 0.88rem;
    color: var(--app-purple-dark);
    text-decoration: none;
    font-weight: 600;
}

.ios-sp-login-back:hover {
    color: var(--app-orange);
}

/* توست / هشدار شبیه اپ */
.ios-sp-login-toast-host {
    position: fixed;
    z-index: 2000;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 32px);
    max-width: 420px;
    pointer-events: none;
}

.ios-sp-login-toast {
    pointer-events: auto;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    display: none;
    animation: iosSpToastIn 0.35s ease;
}

.ios-sp-login-toast.show {
    display: block;
}

.ios-sp-login-toast--error {
    background: #fff;
    border: 2px solid var(--app-error);
    color: #842029;
}

.ios-sp-login-toast--success {
    background: #fff;
    border: 2px solid var(--app-success);
    color: #0f5132;
}

@keyframes iosSpToastIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ios-sp-login-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.ios-sp-login-mode-btn {
    flex: 1;
    border: 2px solid #e8e4ed;
    background: #f5f8fb;
    border-radius: 12px;
    padding: 10px 8px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--app-purple-dark);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.ios-sp-login-mode-btn.active {
    border-color: var(--app-orange);
    background: rgba(255, 107, 53, 0.08);
    color: var(--app-orange-dark);
}

.ios-sp-panel {
    display: none;
}

.ios-sp-panel.active {
    display: block;
}

.ios-sp-otp-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 12px 0;
}

.ios-sp-otp-row input {
    width: 2.5rem;
    height: 2.75rem;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    border: 2px solid #e8e4ed;
    border-radius: 12px;
    background: #fff;
}

.ios-sp-otp-row input:focus {
    border-color: var(--app-purple);
    outline: none;
}

.ios-sp-login-btn-ghost {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--app-purple);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: underline;
}
