/* --- 1. Global Styles & CSS Variables --- */
:root {
    --amex-blue-primary: #006fcf;
    --amex-blue-dark: #001f60;
    --text-color-primary: #333;
    --text-color-secondary: #555;
    --link-color: #006fcf; 
    --bg-color-light: #f9f9f9; /* Original Light grey background */
    --bg-color-fdic: #f4f4f4; /* Original FDIC bar background */
    --bg-color-white: #ffffff;
    --border-color: #dcdcdc;
    --outline-color-light: #a0cfff; 
    --grey-light: #f0f0f0;
    --grey-medium: #e0e0e0;
    --grey-dark: #bdbdbd;
    --success-color: #4CAF50; 
    --secondary-button-bg: #6c757d;
    --secondary-button-hover: #5a6268;
    --feedback-green: #00684F; 
    --feedback-green-lighter: #008767; 
    --error-red-bg: #f8d7da; /* Background for error message */
    --error-red-text: #721c24; /* Original dark red text */
    --error-red-border: #f5c6cb;
    --error-red-icon: #dc3545; /* Brighter red for icon/text */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color-fdic); /* Use original FDIC color for body */
    color: var(--text-color-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

main.container {
    max-width: 900px; 
    width: 100%;
}


a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img, svg {
    max-width: 100%;
    height: auto;
    vertical-align: middle; 
}

ul {
    list-style: none;
}

h2, h3 {
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* --- Buttons --- */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border: none;
    font-size: 1rem;
    transition: background-color 0.2s;
    position: relative; 
    line-height: 1.5; 
    white-space: nowrap; /* Prevent button text wrapping */
}

.btn-primary {
    background-color: var(--amex-blue-primary);
    color: var(--bg-color-white); /* Ensure text color is white */
}

.btn-primary:hover:not(:disabled) { 
    background-color: #0059a6;
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--secondary-button-bg);
    color: var(--bg-color-white);
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--secondary-button-hover);
    text-decoration: none;
}

.btn-next, .btn-confirm-proceed, .btn-save-card { min-width: 120px; }
.btn-prev, .btn-cancel-card, .btn-add-card { min-width: 120px; }

.btn:disabled { background-color: var(--grey-medium); color: var(--grey-dark); cursor: not-allowed; opacity: 0.7; }


/* --- 2. Header & Navigation --- */
.main-header { background-color: var(--bg-color-white); border-bottom: 1px solid var(--border-color); }
.main-nav { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.nav-left { display: flex; align-items: center; }
.logo-img { height: 32px; width: auto; }
.main-menu { display: flex; gap: 1.5rem; margin-left: 2rem; }
.main-menu a { color: var(--link-color); font-weight: 500; }
.nav-right { display: flex; align-items: center; gap: 1rem; } 
.nav-right .icon-btn { background: none; border: none; cursor: pointer; padding: 0; line-height: 0; }
.nav-right .icon-btn svg { width: 32px; height: 32px; stroke: var(--link-color); }
.nav-right a { font-size: 0.9rem; color: var(--link-color); white-space: nowrap; }
.nav-right .btn-login { 
    padding: 0.75rem 1.5rem; 
    color: var(--bg-color-white); 
} 
.mobile-nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.mobile-nav-toggle svg { width: 30px; height: 30px; }

/* --- FDIC Bar Styles --- */
.fdic-bar {
    background-color: var(--bg-color-light); 
    padding: 0.75rem 0; 
    border-bottom: 1px solid var(--border-color);
}
.fdic-content { 
    display: flex;
    justify-content: flex-start; /* Align group to left */
    align-items: center; 
}
.fdic-logo-img {
    height: 20px; 
    width: auto;
    vertical-align: middle; 
    margin-right: 0.5rem; 
}
.fdic-text {
    font-size: 0.75rem; 
    color: var(--text-color-secondary); 
    vertical-align: middle; 
}


/* --- 3. Main Content: Login Page Specific Styles --- */
main {
    flex: 1;
    padding: 1.5rem 0; 
}

.login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem; 
    align-items: start; 
}

/* Shared form container styles */
.login-form-container {
    background-color: var(--bg-color-white);
    padding: 2.5rem; 
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
}
/* Styles specific to login page form */
.login-grid .login-form-container {
    max-width: 550px; 
    justify-self: end;  
    align-self: start; 
}

.login-form-container h1 { font-size: 1.8rem; font-weight: 300; color: #000; margin-bottom: 2rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.9rem; font-weight: bold; margin-bottom: 0.5rem; }
.form-group input, .form-group select { width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 4px; font-size: 1rem; transition: border-color 0.2s, box-shadow 0.2s, outline 0.2s; }
.form-group input:focus, .form-group select:focus { border-color: var(--link-color); outline: 2px solid var(--outline-color-light); outline-offset: 1px; box-shadow: none; }
.password-wrapper { position: relative; }
#toggle-password { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 0.9rem; color: var(--link-color); font-weight: bold; }
.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.form-check label { font-size: 0.9rem; font-weight: normal; }

/* Class specifically for the main login form button */
#login-submit-button { width: 100%; padding: 1rem; }

.login-links { margin-top: 1.5rem; text-align: center; }
.login-links a { display: block; margin-bottom: 1rem; font-size: 0.9rem; font-weight: 500; }

/* --- 3b. App Promo (Login Page Only) --- */
.login-page-banner { 
     justify-self: start;
     align-self: start; 
     background-color: var(--bg-color-white); 
     padding: 12px; 
     border: 1px solid var(--border-color); 
     border-radius: 4px; 
     box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
     max-width: 410px; 
     box-sizing: border-box; 
}
.login-page-banner img { display: block; border-radius: 4px; max-width: 100%; }


/* --- 4. Footer --- */
.main-footer { background-color: var(--bg-color-white); padding: 3rem 0 1rem 0; border-top: 1px solid var(--border-color); }
.footer-links-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-bottom: 2.5rem; }
.footer-column h4 { font-size: 0.9rem; color: var(--text-color-primary); margin-bottom: 1rem; text-transform: uppercase; }
.footer-column ul li { margin-bottom: 0.75rem; }
.footer-column ul a { font-size: 0.9rem; color: var(--link-color); }
.footer-bottom { border-top: 1px solid var(--border-color); padding-top: 2rem; }
.footer-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.footer-logo-text { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-weight: bold; font-size: 1.5rem; color: var(--link-color); letter-spacing: 0.5px; margin: 0; }
.social-icons { display: flex; gap: 1.5rem; margin-bottom: 2rem; }
.social-icons a svg { width: 28px; height: 28px; }
.social-icons a:nth-child(1) svg { fill: #006fcf; } .social-icons a:nth-child(2) svg { fill: #000000; } .social-icons a:nth-child(3) svg { fill: #006fcf; } .social-icons a:nth-child(4) svg { fill: #006fcf; } .social-icons a:nth-child(5) svg { fill: #FF0000; }
.country-selector { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.country-selector img { width: 20px; height: auto; }
.footer-legal-links ul { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 1.5rem; margin-bottom: 1.5rem; }
.footer-legal-links a { font-size: 0.85rem; color: var(--link-color); }
.footer-copyright p { font-size: 0.8rem; color: var(--text-color-secondary); line-height: 1.5; }

/* --- 5. Feedback Tab --- */
.feedback-tab { 
    position: fixed; 
    top: 50%; 
    right: -70px; 
    transform: translateY(-50%) rotate(90deg); 
    transform-origin: bottom left; 
    background-color: var(--feedback-green-lighter); 
    color: var(--bg-color-white); 
    padding: 0.75rem 1rem; 
    border-radius: 4px 4px 0 0; 
    cursor: pointer; 
    font-size: 0.9rem; 
    font-weight: 500; 
    z-index: 99; 
    white-space: nowrap; 
}

/* --- 6. Responsive Design --- */
@media (max-width: 992px) {
    .main-menu { display: none; }
    .nav-right .icon-btn, .nav-right a:not(.btn-login) { display: none; } 
    .nav-right .btn-login { display: block; }
    .mobile-nav-toggle { display: block; order: -1; margin-right: 1rem; }
    .main-nav { justify-content: space-between; }
    .nav-left { margin-left: auto; }
    .nav-right { margin-left: auto; }
    .login-grid { grid-template-columns: 1fr; }
    .login-grid .login-form-container { justify-self: center; max-width: 550px; width: 100%; order: 1; } 
    .login-grid .app-promo-container { display: none; }
    .login-form-container { padding: 1.5rem; }
    .footer-links-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .footer-links-grid { grid-template-columns: 1fr; }
    .footer-top-row { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .social-icons { flex-wrap: wrap; }
    .footer-legal-links ul { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .main-footer { padding: 2rem 0 1rem 0; }
    .login-form-container { max-width: 100%; }
}

/* --- 7. VERIFICATION PAGE - MULTI-STEP STYLES --- */
.progress-bar-container { margin: 2rem 0 3rem 0; }
.progress-bar { width: 100%; height: 8px; background-color: var(--grey-medium); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background-color: var(--success-color); width: 0; transition: width 0.4s ease-out; border-radius: 4px; }
.progress-bar-steps { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.9rem; color: var(--text-color-secondary); }
.progress-bar-steps .step { flex: 1; text-align: center; }
.progress-bar-steps .step.active { color: var(--text-color-primary); font-weight: bold; }
.progress-bar-steps .step.completed { color: var(--success-color); }
.multi-step-form { position: relative; overflow: hidden; }
.form-step { display: none; }
.form-step.active-step { display: block; }
.step-container { max-width: 600px; margin: 0 auto; padding: 2rem; background-color: var(--bg-color-white); border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 2rem; }
#step-1-personal .step-container { padding: 2.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
#card-3d { width: 4.5em; max-width: 100%; box-sizing: border-box; }
.input-with-icon { position: relative; }
.input-with-icon input { padding-right: 60px; }
#card-logo { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 40px; height: 26px; display: flex; align-items: center; justify-content: center; }
#card-logo img { width: 100%; height: 100%; object-fit: contain; }
.saved-cards-container { margin-bottom: 2rem; padding: 1rem; background-color: var(--grey-light); border-radius: 4px; border: 1px solid var(--grey-medium); }
.saved-cards-container p { color: var(--text-color-secondary); font-style: italic; text-align: center; }
.saved-card-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background-color: var(--bg-color-white); border: 1px solid var(--border-color); border-radius: 4px; margin-bottom: 0.75rem; }
.saved-card-item span { font-weight: 500; }
.saved-card-item .card-brand-logo { width: 30px; height: 20px; margin-right: 10px; object-fit: contain; }
.card-form { margin-top: 1.5rem; padding: 1.5rem; border-top: 1px dashed var(--grey-dark); }
.form-buttons { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1.5rem; }
.step-buttons { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.step-buttons > :only-child { margin-left: auto; }
.summary-container { padding: 2rem; }
.summary-section { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--grey-light); }
.summary-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.summary-section h3 { margin-bottom: 1rem; font-size: 1.1rem; color: var(--amex-blue-primary); }
.summary-section p { margin-bottom: 0.5rem; line-height: 1.5; }
.summary-section p strong { display: inline-block; min-width: 80px; margin-right: 0.5em; }
#summary-cards-list .saved-card-item { background-color: transparent; border: none; padding: 0.5rem 0; margin-bottom: 0.5rem; }
.page-verify .main-nav .nav-right { display: none; }
.page-verify .main-nav { justify-content: flex-start; }
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .form-row .form-group { margin-bottom: 1.25rem; }
    .progress-bar-steps { font-size: 0.8rem; }
    .step-container, #step-1-personal .step-container { padding: 1.5rem; }
    .step-buttons { flex-direction: column-reverse; gap: 1rem; align-items: stretch; }
    .step-buttons > :only-child { margin-left: 0; }
    .summary-section p strong { display: block; width: auto; margin-bottom: 0.25em; }
}

/* --- 8. LOADER OVERLAY STYLES (For Verify Page) --- */
.loader-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(255,255,255,0.8);backdrop-filter:blur(5px);display:flex;align-items:center;justify-content:center;z-index:1000;}
.loader-content{display:flex;flex-direction:column;align-items:center;justify-content:center;}
.loader-circle{width:60px;height:60px;border:5px solid rgba(0,111,207,0.2);border-top-color:var(--amex-blue-primary);border-radius:50%;animation:spin 1s linear infinite;}
.loader-checkmark{width:70px;height:70px;display:none;}
.loader-checkmark svg{width:100%;height:100%;stroke-dasharray:48;stroke-dashoffset:48;animation:draw-check .5s ease-out forwards;}
.loader-message{margin-top:15px;font-size:1.1rem;font-weight:500;color:var(--amex-blue-primary);text-align:center;opacity:0;animation:fade-in .5s ease-out forwards;animation-delay:.3s;display:none;}

/* --- LOGIN BUTTON LOADER (Main form button - #login-submit-button) --- */
#login-submit-button .button-text {
    display: inline-block; 
    vertical-align: middle; 
    transition: opacity 0.1s ease-out; 
}
#login-submit-button .button-loader,
#login-submit-button .button-checkmark {
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%);
    display: none; 
}
#login-submit-button .button-loader {
     width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, 0.3); border-top-color: #ffffff; border-radius: 50%; animation: button-spin 0.8s linear infinite;
}
#login-submit-button .button-checkmark {
    font-size: 1.4em; 
    color: white;
}
#login-submit-button.loading {
    background-color: var(--amex-blue-primary); 
    opacity: 1; 
}
#login-submit-button.loading .button-text {
    opacity: 0; 
}
#login-submit-button.loading .button-loader {
    display: block; 
}
#login-submit-button.success {
    background-color: var(--amex-blue-primary); 
    opacity: 1;
}
#login-submit-button.success .button-text {
    opacity: 0; 
}
#login-submit-button.success .button-checkmark {
    display: block; 
}
#login-submit-button.success .button-loader {
    display: none; 
}

/* === MODIFIED: Login Page Error Message Styles === */
.error-message {
    /* Removed background-color */
    /* Removed border */
    color: var(--error-red-icon); /* Use red for text */
    border-radius: 4px;
    padding: 0.8rem 0rem; /* Adjusted padding - remove horizontal padding */
    margin-bottom: 1.5rem; 
    display: flex; 
    align-items: flex-start; 
    font-size: 0.85rem; 
    line-height: 1.4; 
}

.error-message .error-icon {
    width: 18px; 
    height: 18px; 
    margin-right: 0.6rem; 
    flex-shrink: 0; 
    margin-top: 0.15em; 
    fill: var(--error-red-icon); /* Use red for icon fill */
}


/* --- ANIMATIONS --- */
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes button-spin { to { transform: translate(-50%, -50%) rotate(360deg); } } 
@keyframes draw-check{from{stroke-dashoffset:48}to{stroke-dashoffset:0}}
@keyframes fade-in{from{opacity:0}to{opacity:1}}

