/* ==========================================================================
   BestDefense Login Page Styles
   ========================================================================== */

:root {
    --bd-primary: #00aae7;
    --bd-primary-hover: #0095cc;
    --bd-text: #333333;
    --bd-text-muted: #6c757d;
    --bd-border: #e0e0e0;
    --bd-bg: #ffffff;
    --bd-gradient-start: #0b1628;
    --bd-gradient-mid: #162a4a;
    --bd-gradient-end: #0d2137;
}

/* ---------- Layout ---------- */

.bd-login-page {
    display: flex;
    min-height: 100vh;
    background: var(--bd-bg);
}

.bd-login-left {
    width: 520px;
    min-width: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    overflow-y: auto;
    background: var(--bd-bg);
}

.bd-login-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 4rem;
    background: linear-gradient(160deg, var(--bd-gradient-start) 0%, var(--bd-gradient-mid) 50%, var(--bd-gradient-end) 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

/* ---------- Left Panel: Logo ---------- */

.bd-login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.bd-login-logo img {
    height: 60px;
    width: auto;
}

/* ---------- Left Panel: Headings ---------- */

.bd-login-heading {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--bd-text);
    margin-bottom: 0.5rem;
}

.bd-login-subheading {
    font-size: 0.9rem;
    color: var(--bd-text-muted);
    margin-bottom: 1.5rem;
}

/* ---------- Left Panel: Form Fields ---------- */

.bd-form-group {
    margin-bottom: 1rem;
}

.bd-form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: 'Roboto', sans-serif;
    color: var(--bd-text);
    background: var(--bd-bg);
    border: 1px solid var(--bd-border);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bd-form-control:focus {
    outline: none;
    border-color: var(--bd-primary);
    box-shadow: 0 0 0 3px rgba(0, 170, 231, 0.15);
}

.bd-form-control::placeholder {
    color: #adb5bd;
}

/* ---------- Left Panel: Form Row (Remember + Forgot) ---------- */

.bd-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.bd-form-row a {
    color: var(--bd-primary);
    text-decoration: none;
}

.bd-form-row a:hover {
    text-decoration: underline;
}

.bd-form-row label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--bd-text-muted);
    cursor: pointer;
    margin: 0;
}

.bd-form-row input[type="checkbox"] {
    accent-color: var(--bd-primary);
}

/* ---------- Left Panel: Buttons ---------- */

.bd-btn {
    display: inline-block;
    padding: 0.7rem 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
}

.bd-btn-primary {
    background: var(--bd-primary);
    color: #ffffff;
    border-color: var(--bd-primary);
}

.bd-btn-primary:hover {
    background: var(--bd-primary-hover);
    border-color: var(--bd-primary-hover);
    color: #ffffff;
    text-decoration: none;
}

.bd-btn-outline {
    background: transparent;
    color: var(--bd-primary);
    border-color: var(--bd-primary);
}

.bd-btn-outline:hover {
    background: var(--bd-primary);
    color: #ffffff;
    text-decoration: none;
}

.bd-btn-block {
    display: block;
    width: 100%;
}

.bd-btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

.bd-btn-flex {
    flex: 1;
}

.bd-btn-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* ---------- Left Panel: OAuth Divider ---------- */

.bd-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    font-size: 0.8rem;
    color: var(--bd-text-muted);
}

.bd-divider::before,
.bd-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--bd-border);
}

.bd-divider span {
    padding: 0 0.75rem;
    white-space: nowrap;
}

/* ---------- Left Panel: OAuth Buttons ---------- */

.bd-oauth-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.bd-oauth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--bd-border);
    background: var(--bd-bg);
    color: var(--bd-text);
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bd-oauth-btn:hover {
    border-color: var(--bd-primary);
    color: var(--bd-primary);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 170, 231, 0.15);
}

.bd-oauth-btn-full {
    width: 100%;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--bd-border);
    background: var(--bd-bg);
    color: var(--bd-text);
    font-size: 0.9rem;
    font-family: 'Roboto', sans-serif;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0 1rem;
}

.bd-oauth-btn-full:hover {
    border-color: var(--bd-primary);
    color: var(--bd-primary);
    text-decoration: none;
}

/* OAuth-specific icon colors */
.bd-oauth-btn.bd-oauth-github:hover { color: #333; border-color: #333; }
.bd-oauth-btn.bd-oauth-gitlab:hover { color: #fc6d26; border-color: #fc6d26; }
.bd-oauth-btn.bd-oauth-bitbucket:hover { color: #0052cc; border-color: #0052cc; }
.bd-oauth-btn.bd-oauth-google:hover { color: #ea4335; border-color: #ea4335; }
.bd-oauth-btn.bd-oauth-facebook:hover { color: #1877f2; border-color: #1877f2; }
.bd-oauth-btn.bd-oauth-microsoft:hover { color: #00a4ef; border-color: #00a4ef; }
.bd-oauth-btn.bd-oauth-aws:hover { color: #ff9900; border-color: #ff9900; }

/* Google Sign-In widget container */
.bd-google-signin-wrapper {
    margin-bottom: 0.5rem;
}

/* ---------- Left Panel: Form View Switching ---------- */
/* Keyed off m-login--* classes that login.js already toggles */

.bd-login-signin,
.bd-login-signup,
.bd-login-forgot {
    display: none;
}

.bd-login-page.m-login--signin .bd-login-signin { display: block; }
.bd-login-page.m-login--signup .bd-login-signup { display: block; }
.bd-login-page.m-login--forget-password .bd-login-forgot { display: block; }

/* ---------- Left Panel: Footer Links ---------- */

.bd-login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--bd-text-muted);
}

.bd-login-footer a {
    color: var(--bd-primary);
    text-decoration: none;
}

.bd-login-footer a:hover {
    text-decoration: underline;
}

/* ---------- Left Panel: Error/Success Messages ---------- */

.bd-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.bd-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.bd-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ---------- Right Panel: Content Wrapper ---------- */

.bd-marketing-content {
    max-width: 560px;
    width: 100%;
}

/* ---------- Right Panel: Stats Bar ---------- */

.bd-stats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 2rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bd-stat {
    text-align: center;
    min-width: 120px;
}

.bd-stat-number {
    font-family: 'Poppins', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.bd-stat-label {
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* ---------- Right Panel: Testimonial Carousel ---------- */

.bd-testimonial-carousel {
    position: relative;
    min-height: 200px;
    margin-bottom: 3rem;
}

.bd-testimonial-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    pointer-events: none;
}

.bd-testimonial-slide.bd-active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

.bd-testimonial-quote {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 1.5rem;
    border-left: 3px solid var(--bd-primary);
}

.bd-testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bd-testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
    flex-shrink: 0;
}

.bd-testimonial-avatar.bd-avatar-1 { background: #3b82f6; }
.bd-testimonial-avatar.bd-avatar-2 { background: #8b5cf6; }
.bd-testimonial-avatar.bd-avatar-3 { background: #06b6d4; }

.bd-testimonial-name {
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
}

.bd-testimonial-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Carousel Dots */

.bd-carousel-dots {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.bd-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.bd-carousel-dot.bd-active {
    background: var(--bd-primary);
    transform: scale(1.25);
}

/* ---------- Right Panel: Feature Cards ---------- */

.bd-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.bd-feature-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bd-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.bd-feature-icon {
    font-size: 1.5rem;
    color: var(--bd-primary);
    margin-bottom: 0.75rem;
}

.bd-feature-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
    line-height: 1.3;
}

/* ---------- Right Panel: Trust Footer ---------- */

.bd-trust-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bd-trust-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.75rem;
}

.bd-trust-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.bd-trust-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.bd-trust-badge i {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ---------- Responsive: Tablet ---------- */

@media (max-width: 1024px) {
    .bd-login-page {
        flex-direction: column;
    }

    .bd-login-left {
        width: 100%;
        min-width: auto;
        max-width: 500px;
        margin: 0 auto;
        padding: 2rem 2.5rem;
        order: 2;
    }

    .bd-login-right {
        width: 100%;
        padding: 1.5rem 2rem;
        order: 1;
    }

    /* Hide full marketing content on tablet, show condensed strip */
    .bd-testimonial-carousel,
    .bd-features-grid,
    .bd-trust-footer {
        display: none;
    }

    .bd-stats-bar {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .bd-stat-number {
        font-size: 1.75rem;
    }

    .bd-stat-label {
        font-size: 0.7rem;
    }
}

/* ---------- Responsive: Mobile ---------- */

@media (max-width: 768px) {
    .bd-login-right {
        display: none;
    }

    .bd-login-left {
        width: 100%;
        max-width: none;
        padding: 2rem 1.5rem;
        min-height: 100vh;
        order: 1;
    }

    .bd-btn-actions {
        flex-direction: column;
    }
}

/* ---------- Animation: flipInX (reused by login.js) ---------- */

@keyframes flipInX {
    from {
        transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
        animation-timing-function: ease-in;
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
        animation-timing-function: ease-in;
    }
    60% {
        transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
    }
    to {
        transform: perspective(400px);
    }
}

.flipInX {
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    animation-name: flipInX;
}

.animated {
    animation-duration: 0.6s;
    animation-fill-mode: both;
}

/* ---------- Left Panel: Checkbox Groups ---------- */

.bd-checkbox-group {
    font-size: 0.875rem;
}

.bd-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.bd-link {
    color: var(--bd-primary);
}

.bd-link:hover {
    text-decoration: underline;
}

/* ---------- MSA Modal Overrides ---------- */

#msaAccept {
    background-color: #28a745;
    color: white;
}

#msaDecline {
    background-color: #dc3545;
    color: white;
}

/* ---------- Loading Spinner on Button ---------- */

.bd-btn.bd-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.bd-btn.bd-loading::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: bd-spin 0.6s linear infinite;
}

@keyframes bd-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}
