/* ─── Phone OTP Login Widget ─── */

.pol-widget {
    --pol-primary: #6C63FF;
    --pol-primary-hover: color-mix(in srgb, var(--pol-primary) 85%, black);
    --pol-primary-light: color-mix(in srgb, var(--pol-primary) 12%, white);
    --pol-radius: 12px;
    --pol-bg: #ffffff;
    --pol-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    --pol-text: #1a1a2e;
    --pol-text-muted: #6b7280;
    --pol-border: #e5e7eb;
    --pol-error: #ef4444;
    --pol-error-bg: #fef2f2;
    --pol-success: #22c55e;
    --pol-success-bg: #f0fdf4;

    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    max-width: 420px;
    margin: 0 auto;
}

/* Card */
.pol-step {
    background: var(--pol-bg);
    border-radius: var(--pol-radius);
    box-shadow: var(--pol-card-shadow);
    padding: 32px 28px;
    border: 1px solid var(--pol-border);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Header */
.pol-header {
    text-align: center;
    margin-bottom: 28px;
}

.pol-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--pol-primary-light);
    color: var(--pol-primary);
    margin-bottom: 16px;
}

.pol-icon-success {
    background: var(--pol-success-bg);
    color: var(--pol-success);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    animation: pol-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pol-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--pol-text);
    margin: 0 0 6px;
}

.pol-subtitle {
    font-size: 14px;
    color: var(--pol-text-muted);
    margin: 0;
}

/* Form elements */
.pol-form-group {
    margin-bottom: 20px;
}

.pol-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pol-text);
    margin-bottom: 8px;
}

.pol-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid var(--pol-border);
    border-radius: calc(var(--pol-radius) - 2px);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fafafa;
}

.pol-input-wrapper:focus-within {
    border-color: var(--pol-primary);
    box-shadow: 0 0 0 3px var(--pol-primary-light);
    background: #fff;
}

.pol-input-prefix {
    padding: 12px 14px;
    font-size: 15px;
    color: var(--pol-text);
    background: #f3f4f6;
    border-left: 1px solid var(--pol-border);
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.5px;
    direction: ltr;
}

.pol-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 14px;
    font-size: 18px;
    font-weight: 500;
    color: var(--pol-text);
    background: transparent;
    letter-spacing: 2px;
    direction: ltr;
    text-align: left;
}

.pol-input::placeholder {
    color: #d1d5db;
    letter-spacing: 1px;
}

/* OTP Inputs */
.pol-otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
    direction: ltr;
}

.pol-otp-digit {
    width: 60px;
    height: 64px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--pol-text);
    border: 2px solid var(--pol-border);
    border-radius: calc(var(--pol-radius) - 2px);
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    caret-color: var(--pol-primary);
}

.pol-otp-digit:focus {
    border-color: var(--pol-primary);
    box-shadow: 0 0 0 3px var(--pol-primary-light);
    background: #fff;
    transform: translateY(-2px);
}

/* Buttons */
.pol-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: calc(var(--pol-radius) - 2px);
    background: var(--pol-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    min-height: 50px;
    letter-spacing: 0.3px;
}

.pol-btn:hover:not(:disabled) {
    background: var(--pol-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--pol-primary) 30%, transparent);
}

.pol-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pol-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loader */
.pol-loader {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pol-spin 0.7s linear infinite;
}

/* Actions */
.pol-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    gap: 12px;
}

.pol-link {
    background: none;
    border: none;
    color: var(--pol-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 2px;
    transition: opacity 0.2s ease;
}

.pol-link:hover:not(:disabled) {
    opacity: 0.75;
    text-decoration: underline;
}

.pol-link:disabled {
    color: var(--pol-text-muted);
    cursor: default;
}

/* Messages */
.pol-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: calc(var(--pol-radius) - 4px);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    animation: pol-slideUp 0.25s ease;
}

.pol-msg-error {
    background: var(--pol-error-bg);
    color: var(--pol-error);
    border: 1px solid color-mix(in srgb, var(--pol-error) 20%, transparent);
}

.pol-msg-success {
    background: var(--pol-success-bg);
    color: var(--pol-success);
    border: 1px solid color-mix(in srgb, var(--pol-success) 20%, transparent);
}

/* Animations */
@keyframes pol-spin {
    to { transform: rotate(360deg); }
}

@keyframes pol-pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pol-slideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .pol-step {
        padding: 24px 20px;
    }

    .pol-otp-digit {
        width: 52px;
        height: 56px;
        font-size: 20px;
    }

    .pol-otp-inputs {
        gap: 8px;
    }

    .pol-input {
        font-size: 16px;
    }

    .pol-title {
        font-size: 20px;
    }

    .pol-actions {
        flex-direction: column;
        gap: 8px;
    }
}
