/**
 * Login Premium Styles - GlassOS 2.0
 * Enhanced UX Features CSS
 *
 * @author TankFuel SaaS
 * @version 2.0.0
 */

/* ============================================
   PASSWORD STRENGTH METER
============================================ */
.password-strength-meter {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

body[data-theme="light"] .strength-bar {
    background: rgba(0,0,0,0.06);
}

.strength-progress {
    height: 100%;
    width: 0%;
    background: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.strength-text {
    font-size: 0.75rem;
    color: var(--text-dark-soft, #c4cfdd);
    transition: color 0.3s ease;
}

body[data-theme="light"] .strength-text {
    color: var(--text-light-soft, #475569);
}

/* ============================================
   CAPS LOCK INDICATOR
============================================ */
.caps-lock-indicator {
    position: absolute;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.15), rgba(255, 204, 0, 0.1));
    color: #ffaa00;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 10;
    animation: capsLockPulse 1.5s ease-in-out infinite;
}

.caps-lock-indicator svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

@keyframes capsLockPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 170, 0, 0);
    }
}

/* ============================================
   FIELD VALIDATION STATES
============================================ */
.input-error {
    border-color: var(--error, #ff3366) !important;
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.12) !important;
}

.input-success {
    border-color: var(--success, #00ff88) !important;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.12) !important;
}

.field-error {
    color: var(--error, #ff3366);
    font-size: 0.75rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    animation: slideDown 0.2s ease;
}

.field-error::before {
    content: '⚠';
    font-size: 0.85rem;
}

/* ============================================
   SHAKE ANIMATION (Error)
============================================ */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

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

/* ============================================
   BIOMETRIC SECTION
============================================ */
.bio-section {
    padding: 1rem;
    border-radius: 12px;
    background: rgba(5,10,28,0.6);
    border: 1px solid rgba(0, 212, 255, 0.2);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.bio-section:hover {
    background: rgba(5,10,28,0.8);
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.15);
}

body[data-theme="light"] .bio-section {
    background: rgba(248,250,255,0.8);
    border-color: rgba(0, 136, 204, 0.2);
}

body[data-theme="light"] .bio-section:hover {
    background: rgba(248,250,255,1);
    border-color: rgba(0, 136, 204, 0.3);
    box-shadow: 0 8px 24px rgba(0, 136, 204, 0.12);
}

.bio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.bio-title {
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-dark-main, #f4f7ff);
}

body[data-theme="light"] .bio-title {
    color: var(--text-light-main, #0f172a);
}

.bio-device-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bio-device-badge.ios {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    color: #fff;
}

.bio-device-badge.android {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 255, 136, 0.08));
    color: var(--success, #00ff88);
}

.bio-device-badge.windows,
.bio-device-badge.macos,
.bio-device-badge.other {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 212, 255, 0.08));
    color: var(--primary, #00d4ff);
}

.bio-btn {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(123,92,255,0.15));
    color: var(--primary, #00d4ff);
    border: 1px solid rgba(0,212,255,0.3);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    position: relative;
    overflow: hidden;
}

.bio-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.bio-btn:hover::before {
    width: 300px;
    height: 300px;
}

.bio-btn:hover {
    background: linear-gradient(135deg, rgba(0,212,255,0.25), rgba(123,92,255,0.25));
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 212, 255, 0.3);
}

.bio-btn:active {
    transform: scale(0.98) translateY(0);
}

.bio-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.bio-btn-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.bio-unavailable {
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.7;
    padding: 0.75rem 0.5rem;
    margin-top: 0.5rem;
    background: rgba(255, 170, 0, 0.08);
    border-radius: 8px;
    color: #ffaa00;
}

/* ============================================
   LOADING SPINNER (Submit Button)
============================================ */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   RATE LIMIT INDICATOR
============================================ */
.rate-limit-warning {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.15), rgba(255, 51, 102, 0.08));
    border: 1px solid rgba(255, 51, 102, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: start;
    gap: 0.75rem;
    animation: rateLimit Shake 0.5s ease;
}

.rate-limit-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.rate-limit-content {
    flex: 1;
}

.rate-limit-title {
    font-weight: 700;
    color: var(--error, #ff3366);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.rate-limit-message {
    font-size: 0.8rem;
    color: var(--text-dark-soft, #c4cfdd);
    line-height: 1.4;
}

body[data-theme="light"] .rate-limit-message {
    color: var(--text-light-soft, #475569);
}

.rate-limit-countdown {
    font-weight: 700;
    color: var(--error, #ff3366);
    font-family: 'Courier New', monospace;
}

/* ============================================
   SUCCESS CHECKMARK ANIMATION
============================================ */
@keyframes successCheckmark {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(45deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(45deg);
        opacity: 1;
    }
}

.success-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--success, #00ff88);
    border-radius: 50%;
    position: relative;
    margin-left: 0.5rem;
    animation: successCheckmark 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-indicator::after {
    content: '';
    display: block;
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid var(--success, #00ff88);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ============================================
   OAUTH BUTTONS
============================================ */
.oauth-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

body[data-theme="light"] .oauth-section {
    border-top-color: rgba(0,0,0,0.08);
}

.oauth-title {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dark-soft, #c4cfdd);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body[data-theme="light"] .oauth-title {
    color: var(--text-light-soft, #475569);
}

.oauth-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.oauth-btn {
    height: 44px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-dark-main, #f4f7ff);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

body[data-theme="light"] .oauth-btn {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.12);
    color: var(--text-light-main, #0f172a);
}

.oauth-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

body[data-theme="light"] .oauth-btn:hover {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.oauth-btn-icon {
    font-size: 1.2rem;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
============================================ */
@media (max-width: 480px) {
    .caps-lock-indicator {
        right: 2.5rem;
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    .caps-lock-indicator span {
        display: none;
    }

    .bio-btn {
        font-size: 0.85rem;
        height: 44px;
    }

    .oauth-buttons {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ACCESSIBILITY
============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para keyboard navigation */
.bio-btn:focus-visible,
.oauth-btn:focus-visible {
    outline: 2px solid var(--primary, #00d4ff);
    outline-offset: 2px;
}
