/* ========================================
   Poshtibanan SMS - Login Page Styles
   ======================================== */

.poshtibanan-login-wrap {
    --pb-primary: #6366f1;
    --pb-primary-hover: #4f46e5;
    --pb-primary-light: rgba(99, 102, 241, 0.1);
    --pb-bg: #f0f2f5;
    --pb-card: #ffffff;
    --pb-text: #1f2937;
    --pb-text-secondary: #6b7280;
    --pb-border: #e5e7eb;
    --pb-success: #10b981;
    --pb-error: #ef4444;

    max-width: 440px;
    margin: 40px auto;
    font-family: 'IRANSans', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.poshtibanan-card {
    background: var(--pb-card);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid var(--pb-border);
}

.poshtibanan-card-header {
    background: linear-gradient(135deg, var(--pb-primary) 0%, var(--pb-primary-hover) 100%);
    color: #fff;
    padding: 32px 32px 28px;
    text-align: center;
    position: relative;
}

.poshtibanan-card-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--pb-card);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1;
}

.poshtibanan-login-logo {
    max-height: 56px;
    width: auto;
    margin-bottom: 14px;
    border-radius: 10px;
    object-fit: contain;
}

.poshtibanan-card-header h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.poshtibanan-card-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

.poshtibanan-card-body {
    padding: 36px 32px 32px;
}

/* Steps */
.poshtibanan-steps {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.poshtibanan-step {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: var(--pb-border);
    color: var(--pb-text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.poshtibanan-step.active {
    background: var(--pb-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.poshtibanan-step.completed {
    background: var(--pb-success);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.poshtibanan-step-line {
    width: 44px;
    height: 3px;
    align-self: center;
    background: var(--pb-border);
    border-radius: 2px;
    transition: background 0.3s;
}

.poshtibanan-step-line.completed {
    background: var(--pb-success);
}

/* Form elements */
.poshtibanan-form-group {
    margin-bottom: 22px;
}

.poshtibanan-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pb-text);
    margin-bottom: 8px;
}

.poshtibanan-input-wrap {
    position: relative;
}

.poshtibanan-input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pb-text-secondary);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.poshtibanan-input-icon svg {
    width: 20px;
    height: 20px;
}

.poshtibanan-input {
    width: 100%;
    padding: 14px 48px 14px 16px;
    border: 2px solid var(--pb-border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    direction: ltr;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: var(--pb-card);
    color: var(--pb-text);
}

.poshtibanan-input:focus {
    outline: none;
    border-color: var(--pb-primary);
    box-shadow: 0 0 0 4px var(--pb-primary-light);
}

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

.poshtibanan-input.name-input {
    direction: rtl;
    text-align: right;
    padding: 14px 16px 14px 48px;
}

/* OTP input group */
.poshtibanan-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    direction: ltr;
}

.poshtibanan-otp-input {
    width: 54px;
    height: 60px;
    border: 2px solid var(--pb-border);
    border-radius: 14px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    font-family: 'monospace', 'Courier New';
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    box-sizing: border-box;
    background: var(--pb-card);
    color: var(--pb-text);
}

.poshtibanan-otp-input:focus {
    outline: none;
    border-color: var(--pb-primary);
    box-shadow: 0 0 0 4px var(--pb-primary-light);
    transform: scale(1.05);
}

/* Buttons */
.poshtibanan-btn {
    display: block;
    width: 100%;
    padding: 15px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.poshtibanan-btn-primary {
    background: linear-gradient(135deg, var(--pb-primary) 0%, var(--pb-primary-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.poshtibanan-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.poshtibanan-btn-primary:active {
    transform: translateY(0);
}

.poshtibanan-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.poshtibanan-btn-outline {
    background: var(--pb-card);
    color: var(--pb-primary);
    border: 2px solid var(--pb-primary);
}

.poshtibanan-btn-outline:hover {
    background: var(--pb-primary-light);
}

/* Resend timer */
.poshtibanan-resend {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: var(--pb-text-secondary);
}

.poshtibanan-resend a {
    color: var(--pb-primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.poshtibanan-resend a:hover {
    opacity: 0.8;
}

.poshtibanan-timer {
    color: var(--pb-text-secondary);
}

/* Messages */
.poshtibanan-message {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    font-weight: 500;
}

.poshtibanan-message.show {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: poshtibanan-slideDown 0.3s ease;
}

@keyframes poshtibanan-slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.poshtibanan-message-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.poshtibanan-message-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.poshtibanan-message-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Loading spinner */
.poshtibanan-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: poshtibanan-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.poshtibanan-btn .poshtibanan-spinner {
    display: none;
}

.poshtibanan-btn.loading .poshtibanan-spinner {
    display: inline-block;
}

.poshtibanan-btn.loading .btn-text {
    opacity: 0.7;
}

/* Panel visibility */
.poshtibanan-panel {
    display: none;
}

.poshtibanan-panel.active {
    display: block;
    animation: poshtibanan-fadein 0.4s ease;
}

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

/* Logged in state */
.poshtibanan-logged-in {
    text-align: center;
    padding: 48px 40px;
    max-width: 440px;
    margin: 40px auto;
    background: var(--pb-card, #fff);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    font-family: 'IRANSans', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    border: 1px solid var(--pb-border, #e5e7eb);
}

.poshtibanan-logged-in p {
    font-size: 16px;
    margin-bottom: 24px;
    color: var(--pb-text, #1f2937);
}

.poshtibanan-logged-in .poshtibanan-btn {
    display: inline-block;
    width: auto;
    padding: 12px 28px;
    margin: 0 8px;
}

/* Branding */
.poshtibanan-branding {
    text-align: center;
    padding: 18px;
    font-size: 12px;
    color: var(--pb-text-secondary, #9ca3af);
    margin-top: 16px;
}

.poshtibanan-branding a {
    color: var(--pb-primary, #6366f1);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.poshtibanan-branding a:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 480px) {
    .poshtibanan-login-wrap {
        margin: 16px;
        min-height: auto;
    }

    .poshtibanan-card-header {
        padding: 24px 20px 20px;
    }

    .poshtibanan-card-header h2 {
        font-size: 20px;
    }

    .poshtibanan-card-body {
        padding: 28px 20px 24px;
    }

    .poshtibanan-otp-inputs {
        gap: 6px;
    }

    .poshtibanan-otp-input {
        width: 46px;
        height: 52px;
        font-size: 20px;
        border-radius: 12px;
    }

    .poshtibanan-step {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .poshtibanan-step-line {
        width: 30px;
    }

    .poshtibanan-input {
        padding: 12px 44px 12px 14px;
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    .poshtibanan-otp-input {
        width: 40px;
        height: 46px;
        font-size: 18px;
    }

    .poshtibanan-otp-inputs {
        gap: 4px;
    }
}
