  /* === Base Layout === */
body {
    font-family: Arial, sans-serif;
    background: #f7f7fa;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

/* === Login Card === */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(247, 247, 250, 0.95);
    z-index: 1;
}

.logo {
    width: 100px;
    margin-bottom: 30px;
    margin-top: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-frame {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(12, 12, 12, 0.1);
    padding: 20px 0 40px;
    width: 400px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.login-card {
       background: #ffffff;
       border-radius: 16px;
       padding: 10px;
       display: flex;
       flex-direction: column;
       align-items: center;
       position: relative;
       box-shadow: 0 8px 32px rgba(12, 12, 12, 0.1);
       width: 80%;
}

h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 12px 0;
    color: #223046;
    text-align: center;
}

.subtitle {
    color: #5a6473;
    font-size: 1rem;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5;
}

.signin-center {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.divider {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #e0e3ea;
    line-height: 0.1em;
    margin: 30px 0;
    position: relative;
}
.divider span {
    background: #fff;
    padding: 0 15px;
    color: #888;
    font-size: 0.9em;
    position: relative;
    z-index: 1;
}

.email-signin-btn {
    width: 100%;
    padding: 14px 0;
    background: #222;
    color: #ffffff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}
.email-signin-btn:hover {
    background: #444;
    transform: translateY(-1px);
}

/* === Modal Styles === */
.modal-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
    backdrop-filter: blur(3px);
}

.modal-bg.active {
    opacity: 1;
    visibility: visible;
}


.modal-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(12,12,12,0.18);
    padding: 36px 32px 28px 32px;
    width: 420px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2.5px solid #e0e3ea;
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #223046;
    margin-bottom: 30px;
    text-align: center;
}

.modal-bg.active .modal-card {
    transform: translateY(0);
}

.input-group {
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}
.input-group input {
    width: calc(100% - 36px); /* Adjusted width for padding/toggle */
    padding: 14px 18px;
    border: 1px solid #e0e3ea;
    border-radius: 20px;
    font-size: 1rem;
    background: #f7fafa;
    transition: all 0.2s ease;
    /* Removed min-width here if it's causing issues */
}
.input-group input:focus {
    border-color: #222;
    box-shadow: 0 0 0 2px rgba(34,34,34,0.1);
}

.toggle-password {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    font-size: 1.2em;
    padding: 0 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    width: 24px; /* Fixed width */
    height: 24px; /* Fixed height */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toggle-password:hover {
    background: rgba(0,0,0,0.1);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}


.modal-signin-btn {
    width: 90%;
    padding: 14px 0;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}
.modal-signin-btn:hover {
    background: #444;
    transform: translateY(-1px);
}

/* === Dashboard Styles === */
#dashboard-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none; /* Initially hidden */
    align-items: flex-start;
    justify-content: center;
    z-index: 3;
    padding: 40px 20px;
    overflow-y: auto;
    box-sizing: border-box;
    /* Add this for the overlay effect */
    background: rgba(247, 247, 250, 0.95); /* A light, semi-transparent overlay */
}
.dashboard-frame {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(12, 12, 12, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    /* Important: Ensure it's above the background, if you change z-index */
    z-index: 4; /* Higher than dashboard-bg to ensure it's on top */
    position: relative; /* Needed for z-index to work reliably */
}

.dashboard-card {
   width: 100%;
   display: flex;
   flex-direction: column;
   align-items: center;
   border-width: 0.5px;
   padding: 20px;
   border-radius: 16px;
   margin: 10px;
   box-shadow: 0 8px 32px rgba(12, 12, 12, 0.1);
     
}

.signed-in-email {
    color: #5a6473;
    font-size: 1rem;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.dashboard-divider {
    width: 100%;
    border-bottom: 1px solid #e0e3ea;
    margin: 20px 0;
}

.dashboard-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.dashboard-row {
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e3ea;
    width: 100%;
    box-sizing: border-box;
}

.dashboard-row:last-child {
    border-bottom: none;
}

.dashboard-row-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px; /* Increased gap for better separation if title wraps */
    flex-wrap: nowrap; /* Prevent the button from wrapping to the next line */
}

.dashboard-title {
    font-weight: 600;
    flex: 1; /* Allows title to take up maximum available space */
    color: #223046;
    line-height: 1.4;
    word-break: break-word; /* Essential: Allows long words to break and wrap */
    overflow-wrap: break-word; /* Modern equivalent for word-break */
    min-width: 0; /* Allows flex item to shrink below its content size if needed, enabling wrapping */
    padding-right: 10px; /* Small buffer to prevent text from touching button */
}

.access-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 200px; /* Set a specific, fixed width for ALL buttons */
    /* You might need to adjust 180px based on the longest button text ("Access Dashboard")
       plus desired padding. A good rule of thumb is to measure the widest button and add a bit. */
    text-align: center;
    flex-shrink: 0; /* Prevents the button from shrinking */
    flex-grow: 0; /* Prevents the button from growing */
}
.access-btn:hover {
    background: #444;
    transform: translateY(-1px);
}

.access-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.logout-btn {
    width: 180px;
    margin: 30px auto 0;
    padding: 12px 0;
    background: #fff;
    color: #222;
    border: 2px solid #222;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.logout-btn:hover {
    background: #222;
    color: #fff;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-top: 4px solid #222;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 20px;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-20px); }
}

.g_id_signin > div {
    border: 2px solid #3c4043 !important;
    font-weight: bold !important;
    border-radius: 5px;
}
.session-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: fadeInOut 3s forwards;
    font-weight: 500;
    max-width: 90%;
    display: flex;
    align-items: center;
}

.session-toast.error {
    background-color: #d32f2f; /* Red for errors */
    border-left: 5px solid #b71c1c; /* Darker red accent */
}

.session-toast.success {
    background-color: #2e7d32; /* Green for success */
    border-left: 5px solid #1b5e20; /* Darker green accent */
}


/* MFA Modal Styles */
.mfa-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mfa-modal.active {
    opacity: 1;
    pointer-events: all;
}

.mfa-container {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
}

.mfa-header {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid #eeeff3;
}

.mfa-header .mfa-logo {
    height: 40px;
    margin-bottom: 16px;
}

.mfa-header h3 {
    font-size: 1.25rem;
    color: #223046;
    margin: 0 0 4px 0;
    font-weight: 600;
}

.mfa-header p {
    color: #5a6473;
    font-size: 0.875rem;
    margin: 0;
}

.mfa-methods {
    padding: 16px;
}

.mfa-method {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 8px;
}

.mfa-method:hover {
    background: #f7f7fa;
}

.method-icon {
    width: 40px;
    height: 40px;
    background: #f7f7fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.method-icon svg {
    width: 20px;
    height: 20px;
}

.method-details {
    flex: 1;
}

.method-details h4 {
    font-size: 0.9375rem;
    color: #223046;
    margin: 0 0 4px 0;
    font-weight: 500;
}

.method-details p {
    font-size: 0.8125rem;
    color: #8a94a6;
    margin: 0;
}

.method-arrow {
    color: #8a94a6;
    font-size: 1.25rem;
}

/* Verification View */
.mfa-verification {
    padding: 16px;
}

.verification-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.back-button {
    background: none;
    border: none;
    padding: 8px;
    margin-right: 12px;
    cursor: pointer;
}

.verification-header h4 {
    font-size: 1rem;
    color: #223046;
    margin: 0;
    font-weight: 600;
}

.verification-body {
    text-align: center;
}

.verification-body p {
    color: #5a6473;
    font-size: 0.875rem;
    margin: 0 0 24px 0;
}

.code-input {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.code-input input {
    width: 40px;
    height: 48px;
    border: 1px solid #e0e3ea;
    border-radius: 8px;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 500;
    color: #223046;
}

.code-input input:focus {
    border-color: #df29ac;
    outline: none;
    box-shadow: 0 0 0 2px rgba(223,41,172,0.2);
}

.verify-button {
    background: #df29ac;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.verify-button:hover {
    background: #c12295;
}

.resend-text {
    margin-top: 16px !important;
    color: #8a94a6 !important;
}

.resend-text a {
    color: #df29ac;
    text-decoration: none;
    font-weight: 500;
}