/* ==========================================
   Bale Hub Pro - OTP Login Styles v2
   3 Themes: Modern, Minimal, Dark
   ========================================== */

/* CSS Variables */
:root {
    --otp-font: 'Vazirmatn', system-ui, sans-serif;
    --otp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   BASE WRAPPER
   ========================================== */
.bhp-otp-wrapper {
    max-width: 440px;
    margin: 60px auto;
    padding: 0 20px;
    direction: rtl;
    font-family: var(--otp-font);
}

/* ==========================================
   THEME: MODERN (Default - Amber/Emerald)
   ========================================== */
.bhp-otp-theme-modern .bhp-otp-card {
    --card-bg: #FFFFFF;
    --card-border: rgba(245, 158, 11, 0.2);
    --card-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 10px 40px rgba(0,0,0,0.08);
    --text-primary: #1A1814;
    --text-secondary: #4A4538;
    --text-muted: #8A8270;
    --input-bg: #FFFAF0;
    --input-border: #E5E0D5;
    --input-focus: #F59E0B;
    --btn-bg: linear-gradient(135deg, #F59E0B, #D97706);
    --btn-text: #FFFFFF;
    --btn-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
    --code-bg: #FFFAF0;
    --code-border: #E5E0D5;
    --code-filled: #10B981;
    --sent-bg: #FEF3C7;
    --sent-text: #92400E;
    --error-bg: #FEE2E2;
    --error-text: #DC2626;
    --success-bg: #D1FAE5;
    --success-text: #059669;
    --spinner-color: #F59E0B;
    --overlay-bg: rgba(255, 253, 247, 0.8);
}

/* ==========================================
   THEME: MINIMAL
   ========================================== */
.bhp-otp-theme-minimal .bhp-otp-card {
    --card-bg: #FFFFFF;
    --card-border: #E5E7EB;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --input-bg: #F9FAFB;
    --input-border: #D1D5DB;
    --input-focus: #3B82F6;
    --btn-bg: #111827;
    --btn-text: #FFFFFF;
    --btn-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --code-bg: #F9FAFB;
    --code-border: #D1D5DB;
    --code-filled: #10B981;
    --sent-bg: #F3F4F6;
    --sent-text: #374151;
    --error-bg: #FEF2F2;
    --error-text: #DC2626;
    --success-bg: #ECFDF5;
    --success-text: #059669;
    --spinner-color: #111827;
    --overlay-bg: rgba(255, 255, 255, 0.8);
}

/* ==========================================
   THEME: DARK
   ========================================== */
.bhp-otp-theme-dark .bhp-otp-card {
    --card-bg: #1A1A2E;
    --card-border: rgba(245, 158, 11, 0.15);
    --card-shadow: 0 4px 20px rgba(0,0,0,0.4);
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    --input-bg: #16213E;
    --input-border: #334155;
    --input-focus: #F59E0B;
    --btn-bg: linear-gradient(135deg, #F59E0B, #D97706);
    --btn-text: #1A1A2E;
    --btn-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    --code-bg: #16213E;
    --code-border: #334155;
    --code-filled: #10B981;
    --sent-bg: rgba(245, 158, 11, 0.15);
    --sent-text: #FCD34D;
    --error-bg: rgba(239, 68, 68, 0.15);
    --error-text: #FCA5A5;
    --success-bg: rgba(16, 185, 129, 0.15);
    --success-text: #6EE7B7;
    --spinner-color: #F59E0B;
    --overlay-bg: rgba(0, 0, 0, 0.6);
}

/* ==========================================
   CARD
   ========================================== */
.bhp-otp-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    transition: var(--otp-transition);
    position: relative;
    overflow: hidden;
}

.bhp-otp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #F59E0B, #10B981, #F59E0B);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bhp-otp-card:hover::before {
    opacity: 1;
}

/* ==========================================
   LOGO
   ========================================== */
.bhp-otp-logo {
    margin-bottom: 20px;
}

.bhp-otp-logo img {
    max-height: 60px;
    width: auto;
}

.bhp-otp-logo-icon {
    font-size: 56px;
    animation: bhp-otp-float 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes bhp-otp-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==========================================
   TITLE & TEXT
   ========================================== */
.bhp-otp-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.bhp-otp-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}

.bhp-otp-sent-to {
    font-size: 13px;
    color: var(--sent-text);
    margin-bottom: 20px;
    background: var(--sent-bg);
    padding: 10px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bhp-otp-sent-to strong {
    font-weight: 700;
    direction: ltr;
    unicode-bidi: embed;
}

/* ==========================================
   INPUT
   ========================================== */
.bhp-otp-field {
    position: relative;
    margin-bottom: 20px;
}

.bhp-otp-input {
    width: 100%;
    padding: 16px 56px 16px 16px;
    border: 2px solid var(--input-border);
    border-radius: 14px;
    font-family: var(--otp-font);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 2px;
    text-align: center;
    direction: ltr;
    transition: var(--otp-transition);
    background: var(--input-bg);
    color: var(--text-primary);
}

.bhp-otp-input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
    background: var(--card-bg);
}

.bhp-otp-input::placeholder {
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 0;
}

.bhp-otp-field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
}

/* ==========================================
   CODE DIGITS
   ========================================== */
.bhp-otp-code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.bhp-otp-code-digit {
    width: 52px;
    height: 62px;
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    border: 2px solid var(--code-border);
    border-radius: 12px;
    background: var(--code-bg);
    color: var(--text-primary);
    transition: var(--otp-transition);
    font-family: var(--otp-font);
}

.bhp-otp-code-digit:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
    background: var(--card-bg);
    transform: translateY(-2px);
}

.bhp-otp-code-digit.filled {
    border-color: var(--code-filled);
    background: rgba(16, 185, 129, 0.05);
}

/* ==========================================
   BUTTONS
   ========================================== */
.bhp-otp-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    font-family: var(--otp-font);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--otp-transition);
    background: var(--btn-bg);
    color: var(--btn-text);
    box-shadow: var(--btn-shadow);
    letter-spacing: -0.2px;
    position: relative;
    overflow: hidden;
}

.bhp-otp-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bhp-otp-btn:hover {
    transform: translateY(-2px);
}

.bhp-otp-btn:hover::after {
    opacity: 1;
}

.bhp-otp-btn:active {
    transform: translateY(0);
}

.bhp-otp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   RESEND
   ========================================== */
.bhp-otp-resend {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.bhp-otp-link-btn {
    background: none;
    border: none;
    color: #F59E0B;
    font-family: var(--otp-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: var(--otp-transition);
}

.bhp-otp-link-btn:hover {
    color: #D97706;
}

.bhp-otp-link-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    text-decoration: none;
}

#bhp-otp-timer {
    color: #10B981;
    font-weight: 700;
    margin-right: 6px;
    font-size: 12px;
}

/* ==========================================
   ERROR & MESSAGES
   ========================================== */
.bhp-otp-error {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--error-bg);
    color: var(--error-text);
    font-size: 13px;
    font-weight: 500;
    display: none;
    animation: bhp-otp-shake 0.4s ease;
}

.bhp-otp-error.show {
    display: block;
}

@keyframes bhp-otp-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ==========================================
   LOADING
   ========================================== */
.bhp-otp-loading {
    text-align: center;
    padding: 60px 20px;
}

.bhp-otp-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--sent-bg);
    border-top-color: var(--spinner-color);
    border-radius: 50%;
    animation: bhp-otp-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.bhp-otp-loading p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ==========================================
   LOGGED IN
   ========================================== */
.bhp-otp-logged-in {
    text-align: center;
    padding: 24px;
    background: var(--success-bg);
    border-radius: 12px;
    color: var(--success-text);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bhp-otp-logged-in a {
    color: #DC2626;
    font-weight: 600;
}

/* ==========================================
   OVERLAY (for modal mode)
   ========================================== */
.bhp-otp-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: bhp-otp-fadeIn 0.3s ease;
}

@keyframes bhp-otp-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bhp-otp-overlay .bhp-otp-card {
    animation: bhp-otp-slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bhp-otp-slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================
   SIZE VARIANTS
   ========================================== */
.bhp-otp-size-small .bhp-otp-card { max-width: 360px; padding: 28px 20px; }
.bhp-otp-size-small .bhp-otp-title { font-size: 20px; }
.bhp-otp-size-small .bhp-otp-code-digit { width: 42px; height: 50px; font-size: 20px; }

.bhp-otp-size-large .bhp-otp-card { max-width: 520px; padding: 52px 40px; }
.bhp-otp-size-large .bhp-otp-title { font-size: 28px; }
.bhp-otp-size-large .bhp-otp-code-digit { width: 62px; height: 74px; font-size: 28px; }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 480px) {
    .bhp-otp-wrapper {
        margin: 20px auto;
        padding: 0 12px;
    }
    
    .bhp-otp-card {
        padding: 28px 16px;
        border-radius: 16px;
    }
    
    .bhp-otp-title {
        font-size: 20px;
    }
    
    .bhp-otp-code-inputs {
        gap: 6px;
    }
    
    .bhp-otp-code-digit {
        width: 40px;
        height: 50px;
        font-size: 20px;
        border-radius: 10px;
    }
    
    .bhp-otp-input {
        font-size: 16px;
        padding: 14px 48px 14px 14px;
    }
}




/* Steps Guide */
.bhp-otp-steps-guide {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--sent-bg);
    border-radius: 12px;
}

.bhp-otp-guide-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.bhp-otp-guide-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #10B981;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}