/* ========== استایل اصلی ========== */
.kbauth-container {
    max-width: 450px;
    margin: 30px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    overflow: hidden;
    font-family: 'IRANSans', 'Vazir', 'Tahoma', sans-serif;
}

/* تب‌ها */
.kbauth-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.kbauth-tab {
    flex: 1;
    padding: 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    color: #64748b;
    transition: all 0.3s;
    font-family: inherit;
    position: relative;
}

.kbauth-tab.active {
    color: #2563eb;
    font-weight: bold;
}

.kbauth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #2563eb;
}

.tab-icon {
    margin-left: 5px;
}

/* فرم‌ها */
.kbauth-form {
    display: none;
    padding: 30px;
}

.kbauth-form.active {
    display: block;
}

.kbauth-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.kbauth-form-header h3 {
    margin: 0 0 8px;
    color: #1e293b;
    font-size: 22px;
}

.kbauth-form-header p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* فیلدها */
.kbauth-field {
    margin-bottom: 20px;
}

.kbauth-field label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
}

.kbauth-field small {
    display: block;
    margin-top: 5px;
    color: #94a3b8;
    font-size: 12px;
}

.required {
    color: #ef4444;
}

.optional {
    color: #94a3b8;
    font-size: 12px;
}

.kbauth-field input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    box-sizing: border-box;
    font-family: inherit;
}

.kbauth-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* کپچا */
.kbauth-captcha {
    background: #f8fafc;
    padding: 15px;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
}

.captcha-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.captcha-question {
    color: #475569;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    padding: 5px;
    background: #fff;
    border-radius: 5px;
}

/* دکمه‌ها */
.kbauth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    margin-top: 10px;
}

.kbauth-btn-primary {
    background: #ff4e0e;
    color: #fff;
}

.kbauth-btn-primary:hover {
    background: #ff4e0eb5;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(37,99,235,0.3);
}

.kbauth-btn-success {
    background: #10b981;
    color: #fff;
}

.kbauth-btn-success:hover {
    background: #059669;
}

.kbauth-btn-outline {
    background: #fff;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.kbauth-btn-outline:hover {
    background: #eff6ff;
}

.kbauth-btn-danger {
    background: #ef4444;
    color: #fff;
}

/* لینک‌ها */
.kbauth-links {
    text-align: center;
    margin-top: 15px;
}

.kbauth-links a {
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
}

.kbauth-links a:hover {
    text-decoration: underline;
}

.kbauth-terms {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin-top: 15px;
}

.kbauth-terms a {
    color: #2563eb;
}

/* پیام‌ها */
.kbauth-message {
    margin: 15px 0;
    padding: 12px 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
}

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

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

/* OTP Input */
.otp-input {
    text-align: center;
    font-size: 24px !important;
    letter-spacing: 10px;
    direction: ltr;
}

/* کاربر لاگین شده */
.kbauth-logged-in {
    max-width: 400px;
    margin: 30px auto;
}

.kbauth-user-card {
    text-align: center;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.kbauth-user-avatar {
    font-size: 60px;
    margin-bottom: 15px;
}

.kbauth-user-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.kbauth-user-actions .kbauth-btn {
    flex: 1;
    text-decoration: none;
    text-align: center;
}

/* ریسپانسیو */
@media (max-width: 480px) {
    .kbauth-container {
        margin: 15px;
        border-radius: 12px;
    }
    
    .kbauth-form {
        padding: 20px;
    }
    
    .kbauth-user-actions {
        flex-direction: column;
    }
}

.captcha-hint {
    display: block;
    text-align: center;
    font-size: 12px;
    color: #006513;
    background: #f6efda;
    padding: 5px 10px;
    border-radius: 5px;
    margin: 5px 0;
    letter-spacing: 2px;
    direction: ltr;
}
