/* auth.css — Global Authentication & Login Styles */

/* Base & Layout Root */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.bp-auth-root {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    background: #042f1a;
    background: radial-gradient(circle at 10% 20%, #0d6b38 0%, #064e2b 45%, #032414 100%);
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Wavy Background Shapes */
.bp-auth-backdrop-waves {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bp-auth-backdrop-waves svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bp-auth-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.4;
}

/* Main Container */
.bp-auth-container {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    max-width: 1440px;
    min-height: 100vh;
    padding: 32px 48px;
    box-sizing: border-box;
}

/* Left Hero Panel */
.bp-auth-left {
    flex: 1.35;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 48px;
    box-sizing: border-box;
}

.bp-auth-left-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

/* Top Logo */
.bp-auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.bp-auth-logo-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

.bp-auth-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.02em;
}

/* Main Grid inside Left Section */
.bp-auth-main-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
    align-items: center;
    margin: auto 0;
}

/* Typography */
.bp-auth-hero-heading {
    margin-bottom: 18px;
}

.bp-auth-title-line {
    font-size: 2.4rem;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.025em;
}

.bp-auth-title-accent-wrap {
    display: inline-block;
    position: relative;
}

.bp-auth-title-accent {
    font-size: 2.4rem;
    font-weight: 700;
    color: #22C55E;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.025em;
}

.bp-auth-accent-underline {
    width: 100%;
    height: 4px;
    background: #22C55E;
    border-radius: 2px;
    margin-top: 4px;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.bp-auth-hero-desc {
    font-size: 0.94rem;
    line-height: 1.55;
    color: rgba(241, 245, 249, 0.82);
    margin: 0 0 28px 0;
    max-width: 420px;
}

/* Feature List */
.bp-auth-features-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bp-auth-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.92rem;
    font-weight: 500;
}

.bp-auth-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4ADE80;
    flex-shrink: 0;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* 3D Scene SVG Illustration */
.bp-auth-illustration-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-3d-scene-svg {
    width: 100%;
    max-width: 480px;
    max-height: 380px;
    height: auto;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.3));
}

/* Wind Turbine Animation */
@keyframes spinTurBine {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.bp-wind-blades {
    transform-origin: 20px 70px;
    animation: spinTurBine 12s linear infinite;
}

/* Copyright Footer */
.bp-auth-left-footer {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 16px;
}

/* Right Section */
.bp-auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 24px;
    box-sizing: border-box;
}

/* ─── FLOATING WHITE LOGIN CARD ─── */
.bp-login-card-wrapper {
    width: 100%;
    max-width: 440px;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 40px 40px 32px 40px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 25px 50px -12px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

.bp-login {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Badge Avatar Top Icon */
.bp-login-badge-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.bp-login-badge-inner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #F0FDF4;
    border: 1px solid #DCFCE7;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.08);
}

/* Card Header */
.bp-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.bp-login-welcome {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 6px 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.bp-login-subtitle {
    font-size: 0.92rem;
    color: #64748B;
    margin: 0;
    line-height: 1.4;
}

/* Form */
.bp-login-form {
    display: flex;
    flex-direction: column;
}

.bp-field {
    position: relative;
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.bp-field-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

/* MudTextField styling overrides */
.bp-field .mud-input-outlined {
    position: relative;
}

.bp-field .mud-input-outlined fieldset {
    display: none !important;
}

.bp-field .mud-input.mud-input-outlined.mud-input-root {
    border-radius: 10px !important;
    border: 1.5px solid #E2E8F0 !important;
    background: #FFFFFF !important;
    min-height: 48px !important;
    padding: 0 14px !important;
    transition: all 0.2s ease !important;
}

.bp-field .mud-input.mud-input-outlined.mud-input-root:hover {
    border-color: #CBD5E1 !important;
}

.bp-field .mud-input.mud-input-outlined.mud-input-focused {
    border-color: #16A34A !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15) !important;
}

.bp-field .mud-input-outlined input {
    font-size: 0.95rem !important;
    color: #0F172A !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

.bp-field .mud-input-outlined input::placeholder {
    color: #94A3B8 !important;
    opacity: 1 !important;
}

.bp-field .mud-input-adornment-start {
    color: #94A3B8 !important;
    margin-right: 10px !important;
}

/* Toggle Password Eye Button */
.bp-password-toggle-btn {
    position: absolute;
    right: 14px;
    top: 38px;
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease;
    z-index: 5;
}

.bp-password-toggle-btn:hover {
    color: #16A34A;
}

/* Actions Row: Remember Me + Forgot Password */
.bp-login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 22px 0;
}

.bp-login .mud-checkbox-text {
    font-size: 0.88rem;
    color: #334155;
    font-weight: 500;
}

.bp-forgot-password-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: #16A34A;
    text-decoration: none;
    transition: color 0.15s ease;
}

.bp-forgot-password-link:hover {
    color: #15803D;
    text-decoration: underline;
}

/* Error Banner */
.bp-login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    color: #DC2626;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Primary Sign In Button */
.bp-login-submit {
    width: 100% !important;
    height: 50px !important;
    border-radius: 10px !important;
    background: #15803D !important;
    color: #FFFFFF !important;
    font-size: 0.98rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.25) !important;
    transition: all 0.2s ease !important;
}

.bp-login-submit:hover:not(:disabled) {
    background: #166534 !important;
    box-shadow: 0 6px 16px rgba(21, 128, 61, 0.35) !important;
}

.bp-submit-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Divider */
.bp-login-divider {
    display: flex;
    align-items: center;
    margin: 22px 0;
}

.bp-divider-line {
    flex: 1;
    height: 1px;
    background: #E2E8F0;
}

.bp-divider-text {
    padding: 0 14px;
    font-size: 0.85rem;
    color: #94A3B8;
}

/* SSO Button */
.bp-sso-button {
    width: 100%;
    height: 48px;
    border-radius: 10px;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    color: #0F172A;
    font-size: 0.94rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bp-sso-button:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.bp-sso-icon {
    color: #64748B;
}

/* Card Security Footer */
.bp-login-security-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    color: #64748B;
    font-size: 0.85rem;
}

/* Authorized state */
.bp-login-authorized {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
}

.bp-login-authorized-text {
    font-size: 0.95rem;
    color: #475569;
}

.bp-login-authorized-progress {
    width: 100%;
}

/* Troubleshoot Button */
.bp-login-troubleshoot {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.bp-login-troubleshoot:hover {
    background: rgba(15, 23, 42, 0.9);
}

/* Responsive Media Queries */
@media (max-width: 1200px) {
    .bp-auth-container {
        padding: 24px 32px;
    }
    .bp-auth-main-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .bp-auth-illustration-container {
        max-width: 360px;
        margin: 0 auto;
    }
}

@media (max-width: 900px) {
    .bp-auth-container {
        flex-direction: column;
        padding: 20px;
    }
    .bp-auth-left {
        padding-right: 0;
        margin-bottom: 32px;
    }
    .bp-auth-right {
        padding-left: 0;
        width: 100%;
    }
    .bp-auth-illustration-container {
        display: none;
    }
}

@media (max-width: 480px) {
    .bp-login-card-wrapper {
        padding: 28px 20px 24px 20px;
        border-radius: 16px;
    }
}

/* Mode Switcher Container */
.bp-toggle-mode-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    font-size: 0.88rem;
    color: #64748B;
}

.bp-toggle-mode-btn {
    background: transparent;
    border: none;
    color: #16A34A;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.88rem;
    padding: 0;
}

.bp-toggle-mode-btn:hover {
    color: #15803D;
}

/* Quick Fill Demo Accounts */
.bp-quick-accounts {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 10px 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
}

.bp-quick-title {
    font-size: 0.78rem;
    color: #64748B;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bp-quick-buttons {
    display: flex;
    gap: 8px;
}

.bp-quick-chip {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bp-quick-chip:hover {
    background: #F0FDF4;
    border-color: #16A34A;
    color: #16A34A;
}
