/* ==========================================
   Digits Auth Plugin - Clean Minimal CSS 2025
   ========================================== */

/* Reset & Base */
.digits-auth-container * {
    box-sizing: border-box;
}

.digits-auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
    text-align: right;
}

/* Auth Card */
.digits-auth-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 32px 24px;
    border: 1px solid #e5e7eb;
    position: relative;
}

.digits-auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #7EAD91;
}

/* Header */
.digits-auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.digits-auth-title {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.digits-auth-subtitle {
    color: #6b7280;
    font-size: 15px;
    margin: 0;
    font-weight: 400;
}

/* Step Indicator */
.digits-step-indicator {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-right: 3px solid #7EAD91;
}

.digits-step-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 4px 0;
}

.digits-step-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Form Groups */
.digits-form-group {
    margin-bottom: 20px;
    position: relative;
}

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

.digits-input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 45px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    background: #ffffff;
    transition: border-color 0.2s ease;
    outline: none;
    color: #111827;
}

.digits-input:focus {
    border-color: #7EAD91;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.digits-input:focus + .digits-input-icon {
    color: #7EAD91;
}

.digits-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: color 0.2s ease;
    pointer-events: none;
}

/* Code Input Special Styling */
.digits-code-input {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 6px;
    padding-right: 16px;
}

.digits-code-filled .digits-code-input {
    border-color: #10b981;
    background: #f0fdf4;
}

/* Buttons */
.digits-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.digits-btn-primary {
    background: #7EAD91;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.digits-btn-primary:hover:not(:disabled) {
    background: #2563eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.digits-btn-primary:active {
    background: #1d4ed8;
}

.digits-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.digits-btn-arrow {
    transition: transform 0.2s ease;
}

.digits-btn:hover .digits-btn-arrow {
    transform: translateX(-3px);
}

/* Resend Button */
.digits-resend-btn {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #7EAD91;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    margin: 0 auto;
}

.digits-resend-btn:hover {
    background: #f9fafb;
    border-color: #7EAD91;
}

/* Timer Section */
.digits-timer-section {
    text-align: center;
    margin: 20px 0;
}

.digits-timer {
    margin-bottom: 16px;
}

#digits-countdown {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Messages */
.digits-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
    border: 1px solid;
}

.digits-message.success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.digits-message.error {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Success Container */
.digits-success-container {
    text-align: center;
    padding: 40px 20px;
}

.digits-success-animation {
    margin-bottom: 24px;
}

.digits-checkmark {
    color: #10b981;
    animation: checkmark-bounce 0.5s ease-out;
}

@keyframes checkmark-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.digits-success-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.digits-success-text {
    color: #6b7280;
    margin: 0;
    font-size: 15px;
}

/* Logged In State */
.digits-logged-in {
    max-width: 350px;
}

.digits-welcome-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.digits-user-avatar {
    margin-bottom: 16px;
}

.digits-user-avatar img {
    border-radius: 50%;
    border: 2px solid #e5e7eb;
}

.digits-welcome-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #111827;
}

.digits-welcome-text {
    color: #6b7280;
    margin: 0 0 24px 0;
    font-size: 15px;
}

.digits-dashboard-btn {
    background: #f9fafb;
    color: #374151;
    border: 1px solid #d1d5db;
}

.digits-dashboard-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Utility Classes */
.digits-hidden {
    display: none !important;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .digits-auth-container {
        padding: 16px;
    }
    
    .digits-auth-card {
        padding: 24px 20px;
        border-radius: 10px;
    }
    
    .digits-auth-title {
        font-size: 22px;
    }
    
    .digits-input {
        padding: 11px 14px;
        padding-right: 40px;
        font-size: 16px;
    }
    
    .digits-btn {
        padding: 11px 18px;
    }
    
    .digits-code-input {
        font-size: 18px;
        letter-spacing: 5px;
    }
}

/* Loading Animation */
.digits-btn:disabled::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth Transitions */
.digits-form {
    transition: opacity 0.2s ease;
}

.digits-form.digits-hidden {
    opacity: 0;
}

/* Focus Management */
.digits-input:focus-visible {
    outline: 2px solid #7EAD91;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}