:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #4b5563;
    --border: #d1d5db;
    --error: #ef4444;
    --icon-bg: #f9fafb;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }

body, html {
    min-height: 100vh; 
    width: 100%;
    background-color: var(--bg-color);
    display: flex; 
    justify-content: center; 
    padding: 20px 10px; 
}

/* --- BASE STYLES (Mobile First) --- */
.payment-container {
    background: var(--card-bg);
    width: 100%; max-width: 550px; 
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    display: flex; flex-direction: column;
    margin: auto; 
}

.form-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px; margin-bottom: 8px;
}

.header-logo-img { 
    height: 70px;          /* Keep whatever height you liked best */
    width: auto;           
    max-width: 30%;        /* THE FIX: Forces the logo to shrink on small screens instead of overlapping */
    object-fit: contain;   
    object-position: left; 
}
.header-abn { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.eway-img { height: 22px; width: auto; }

.section-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
    margin: 6px 0 8px; padding-bottom: 4px;
    min-height: 36px; /* Adjust this to be slightly taller than your card logos */
}
.section-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.card-logos { display: flex; gap: 4px; align-items: center; }
.card-logos img { height: 32px; width: auto; object-fit: contain; }

.form-columns { display: flex; flex-direction: column; gap: 0; }
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.grid-3-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 10px; }

.form-group { position: relative; margin-bottom: 14px; } 
label { display: block; font-size: 11px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }

input:not(.icon-input):not([type="checkbox"]), select {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text-main); transition: border-color 0.2s;
}
input:not(.icon-input):focus, select:focus { outline: none; border-color: var(--primary); }

.icon-input-wrapper { display: flex; border: 1px solid var(--border); border-radius: 6px; background: #fff; transition: border-color 0.2s; overflow: hidden; }
.icon-input-wrapper:focus-within { border-color: var(--primary); }
.icon-input-wrapper input { border: none; flex-grow: 1; padding: 8px 10px; font-size: 13px; color: var(--text-main); outline: none; width: 100%; }
.icon-box { display: flex; align-items: center; justify-content: center; background-color: var(--icon-bg); border-left: 1px solid var(--border); padding: 0 10px; color: #6b7280; }

input.is-invalid, select.is-invalid, .icon-input-wrapper.is-invalid, .captcha-box.is-invalid { border-color: var(--error); }
.error-msg { color: var(--error); font-size: 10px; position: absolute; bottom: -13px; left: 0; opacity: 0; visibility: hidden; transition: 0.2s; white-space: nowrap; font-weight: 600; }
.is-invalid ~ .error-msg, .is-invalid + .error-msg { opacity: 1; visibility: visible; }

.cvn-wrapper { position: relative; display: flex; align-items: center; }
.info-icon { position: absolute; right: 6px; background: #e5e7eb; color: var(--text-muted); width: 16px; height: 16px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 10px; font-weight: bold; cursor: help; }

.captcha-box { display: flex; justify-content: space-between; align-items: center; background: #f9f9f9; border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; }
.captcha-box label { margin-bottom: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; font-weight: 500;}
.captcha-box input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

.bottom-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.submit-btn { width: 100%; padding: 12px; background-color: var(--primary); color: white; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.submit-btn:hover:not(:disabled) { background-color: var(--primary-hover); }
.submit-btn:disabled { background-color: #9ca3af; cursor: not-allowed; }

/* --- Footer Styling --- */
.form-footer { 
    margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); 
    font-size: 11px; color: var(--text-muted); line-height: 1.5; 
    text-align: center; 
}
.footer-seal-container { margin-top: 20px; }
.footer-eway-img { height: 90px; width: auto; }

/* --- LAPTOP / DESKTOP (Side-by-side) --- */
@media (min-width: 768px) {
    .payment-container { max-width: 800px; padding: 24px 32px; }
    .header-logo-img { height: 40px; width: 180px; }
    .header-abn { font-size: 12px; }
    .eway-img { height: 26px; }
    .section-title { font-size: 12px; margin-bottom: 8px; }
    
    .form-columns { flex-direction: row; gap: 24px; }
    .column-left, .column-right { flex: 1; }
    
    .bottom-actions { align-items: center; flex-direction: row; justify-content: space-between; margin-top: 16px; }
    .bottom-actions .form-group { width: 100%; max-width: 350px; margin-bottom: 0; }
    .bottom-actions .submit-btn { width: 100%; max-width: 350px; margin-top: 0; }
    
    .form-footer { display: flex; flex-direction: column; align-items: center; }
    .footer-seal-container { margin-top: 20px; }
    .footer-eway-img { height: 100px; }
}

/* --- LARGE MONITORS --- */
@media (min-width: 1440px) {
    .payment-container { max-width: 950px; padding: 32px 48px; }
    .header-logo-img { height: 48px; width: 200px; }
    .header-abn { font-size: 14px; }
    .eway-img { height: 32px; }
    .section-title { font-size: 14px; }
    
    label { font-size: 13px; margin-bottom: 6px; }
    input:not(.icon-input):not([type="checkbox"]), select, .icon-input-wrapper input { font-size: 15px; padding: 10px 14px; }
    
    .captcha-box { padding: 10px 14px; }
    .captcha-box label { font-size: 13px; }
    .submit-btn { padding: 14px; font-size: 16px; }
    
    .form-footer { font-size: 13px; margin-top: 24px; padding-top: 20px; }
    .footer-eway-img { height: 120px; }
}