/* Grok Auth Pro - Frontend Styles */
.grok-auth-wrapper {
    font-family: Vazirmatn, Tahoma, system-ui, -apple-system, sans-serif;
    direction: rtl;
    max-width: 420px;
    margin: 40px auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.grok-auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
}

.grok-auth-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.grok-tab {
    flex: 1;
    padding: 16px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.grok-tab.active {
    color: var(--grok-primary, #4f46e5);
    background: #fff;
}

.grok-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--grok-primary, #4f46e5);
    border-radius: 3px 3px 0 0;
}

.grok-panel {
    padding: 28px 24px 32px;
}

.grok-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
}

.grok-desc {
    margin: 0 0 24px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
    line-height: 1.6;
}

.grok-field {
    margin-bottom: 16px;
}

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

.grok-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #fff;
    color: #0f172a;
}

.grok-input:focus {
    outline: none;
    border-color: var(--grok-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.grok-channels {
    margin-bottom: 20px;
}

.grok-channels-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.grok-channel-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.grok-channel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
}

.grok-channel:has(input:checked) {
    border-color: var(--grok-primary, #4f46e5);
    background: rgba(79, 70, 229, 0.06);
    color: var(--grok-primary, #4f46e5);
}

.grok-channel input {
    margin: 0;
    accent-color: var(--grok-primary, #4f46e5);
}

.grok-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    box-sizing: border-box;
}

.grok-btn-primary {
    background: var(--grok-primary, #4f46e5);
    color: #fff;
}

.grok-btn-primary:hover {
    background: var(--grok-primary-hover, #4338ca);
}

.grok-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.grok-btn-outline {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    color: #334155;
    margin-top: 10px;
}

.grok-btn-outline:hover {
    border-color: var(--grok-primary, #4f46e5);
    color: var(--grok-primary, #4f46e5);
}

.grok-btn-link {
    background: transparent;
    color: #64748b;
    font-weight: 500;
    font-size: 13px;
    margin-top: 12px;
    padding: 8px;
}

.grok-btn-link:hover {
    color: var(--grok-primary, #4f46e5);
}

.grok-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #94a3b8;
    font-size: 12px;
}

.grok-divider::before,
.grok-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.grok-divider span {
    padding: 0 12px;
}

/* OTP Inputs */
.grok-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
    direction: ltr;
}

.grok-otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s;
}

.grok-otp-digit:focus {
    outline: none;
    border-color: var(--grok-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.grok-messages {
    padding: 0 24px 20px;
}

.grok-message {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
    line-height: 1.5;
}

.grok-message.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.grok-message.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.grok-auth-logged-in {
    text-align: center;
    padding: 40px 20px;
}

/* Minimal style */
.grok-style-minimal .grok-auth-card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

/* Classic */
.grok-style-classic .grok-auth-card {
    border-radius: 4px;
}

.grok-style-classic .grok-btn {
    border-radius: 4px;
}

.grok-style-classic .grok-input {
    border-radius: 4px;
}

/* Loading spinner */
.grok-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: grok-spin 0.6s linear infinite;
}

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

@media (max-width: 480px) {
    .grok-auth-wrapper {
        margin: 20px auto;
    }
    .grok-otp-digit {
        width: 42px;
        height: 50px;
        font-size: 18px;
    }
}
