/* BBIF Auth System Styles v2.0 */

.bbif-auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.bbif-auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 52px 44px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: bbifFadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: center bottom;
}

@keyframes bbifFadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bbif-auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.bbif-auth-header h2 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bbif-auth-header p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 16px;
    margin: 0;
    font-weight: 400;
}

.bbif-auth-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.bbif-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bbif-form-group label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.bbif-form-group input[type="text"],
.bbif-form-group input[type="password"],
.bbif-form-group input[type="email"] {
    width: 100%;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.bbif-form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}

.bbif-form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.bbif-password-wrapper {
    position: relative;
}

.bbif-password-wrapper input {
    padding-right: 52px;
}

.bbif-toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbif-toggle-password:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.2);
}

.bbif-eye {
    display: block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}

.bbif-eye.bbif-eye-slash {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21'/%3E%3C/svg%3E");
}

.bbif-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.bbif-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

.bbif-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    cursor: pointer;
    border-radius: 6px;
}

.bbif-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    position: relative;
}

.bbif-link:hover {
    color: #ffffff;
}

.bbif-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bbif-link:hover::after {
    width: 100%;
}

.bbif-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 28px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
}

.bbif-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.bbif-btn:hover::before {
    left: 100%;
}

.bbif-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.bbif-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.bbif-btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.bbif-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.bbif-btn:disabled::before {
    display: none;
}

.bbif-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: bbifSpin 0.7s linear infinite;
    margin-left: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bbif-btn:disabled .bbif-spinner {
    opacity: 1;
}

@keyframes bbifSpin {
    to {
        transform: rotate(360deg);
    }
}

.bbif-auth-error,
.bbif-auth-message,
.bbif-fallback-error {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    animation: bbifShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.bbif-auth-error,
.bbif-fallback-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.25);
    backdrop-filter: blur(10px);
}

.bbif-auth-message {
    background: rgba(34, 197, 94, 0.15);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.25);
    backdrop-filter: blur(10px);
    animation: bbifFadeIn 0.4s ease;
}

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

@keyframes bbifShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.bbif-auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bbif-auth-footer p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    margin: 0;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 520px) {
    .bbif-auth-card {
        padding: 36px 28px;
        border-radius: 24px;
        max-width: 100%;
    }

    .bbif-auth-header h2 {
        font-size: 26px;
    }

    .bbif-form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .bbif-btn {
        padding: 14px 24px;
    }
}

@media (max-width: 360px) {
    .bbif-auth-card {
        padding: 28px 22px;
        border-radius: 20px;
    }

    .bbif-auth-header h2 {
        font-size: 24px;
    }
}

/* Accessibility: Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bbif-auth-card,
    .bbif-auth-error,
    .bbif-auth-message,
    .bbif-form-group input,
    .bbif-btn,
    .bbif-link::after {
        animation: none !important;
        transition: none !important;
    }
}