/* ================================================================
   loancert.css — UCO Bank Loan Certificate Portal
   All styles for loanInputForm.jsp
   No inline styles needed when this file is linked.
================================================================ */

/* ============================================================
   Reset & Base
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue:      #004a99;
    --blue-dark: #003370;
    --gold:      #ffcc00;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-900: #0f172a;
    --white:     #ffffff;
    --bg:        #f8fafc;
    --card-shadow: 0 10px 40px rgba(0,0,0,0.07);
}

html, body {
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    font-size: 14px;
    background-color: var(--bg);
    background-image: radial-gradient(#cbd5e1 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    background-attachment: fixed;
    color: var(--slate-900);
}

/* ============================================================
   Fixed Header
============================================================ */
.site-header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 88px;
    background: rgba(0,74,153,0.93);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    padding: 0 36px;
    z-index: 200;
}

.logo-badge {
    background: var(--gold);
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 8px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    flex-shrink: 0;
}

.logo-badge img {
    height: 44px;
    width: auto;
    display: block;
}

.header-title {
    margin-left: 22px;
    color: var(--white);
    font-size: 1.15rem;
    line-height: 1.3;
}

.header-title strong {
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.gold-bar {
    position: fixed;
    top: 88px; left: 0;
    width: 100%;
    height: 3px;
    background: var(--gold);
    z-index: 201;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ============================================================
   Main Card
============================================================ */
.page-wrap {
    padding-top: 150px;
    padding-bottom: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
}

.main-card {
    background: var(--white);
    border-radius: 18px;
    width: 980px;
    max-width: 96%;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(209,220,232,0.55);
    display: flex;
    overflow: hidden;
    min-height: 560px;
}

/* ============================================================
   Sidebar
============================================================ */
.sidebar {
    width: 36%;
    flex-shrink: 0;
    padding: 48px 38px;
    background: rgba(248,250,252,0.85);
    border-right: 1px solid rgba(226,232,240,0.7);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-eyebrow {
    font-size: 10px;
    font-weight: 800;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    display: block;
    margin-bottom: 16px;
}

.sidebar h1 {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.22;
    color: var(--slate-900);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.sidebar-desc {
    font-size: 13px;
    color: var(--slate-500);
    line-height: 1.65;
    font-weight: 500;
    margin-bottom: 28px;
}

.feature-list { display: flex; flex-direction: column; gap: 10px; }

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-700);
}

.check-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sidebar-footer {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--slate-400);
    border-top: 1px solid var(--slate-200);
    padding-top: 20px;
    margin-top: 30px;
}

/* ============================================================
   Form Section
============================================================ */
.form-section {
    flex: 1;
    padding: 48px 56px;
    background: var(--white);
}

.form-heading { margin-bottom: 32px; }

.form-heading h2 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}

.heading-bar {
    width: 44px;
    height: 5px;
    background: var(--gold);
    border-radius: 999px;
    margin-top: 10px;
}

.form-grid { display: flex; flex-direction: column; gap: 20px; }

.field-group { display: flex; flex-direction: column; }

label.field-label {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 7px;
    display: block;
}

.field-input,
.field-select {
    background: #f8fafc;
    border: 1.5px solid var(--slate-200);
    border-radius: 10px;
    padding: 11px 15px;
    width: 100%;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--slate-900);
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.field-input::placeholder { color: #b5c0cc; font-weight: 400; }

.field-input:focus,
.field-select:focus {
    background: var(--white);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,74,153,0.10);
}

/* Custom select arrow */
.select-wrap { position: relative; }
.select-wrap::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-top: 6px solid var(--slate-500);
    pointer-events: none;
}
.select-wrap .field-select { padding-right: 34px; cursor: pointer; }

/* Disabled select */
.field-select:disabled {
    background: var(--slate-100);
    color: var(--slate-400);
    cursor: not-allowed;
    border-color: var(--slate-200);
}

/* ============================================================
   CAPTCHA row
============================================================ */
.captcha-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.captcha-img-wrap { display: flex; flex-direction: column; gap: 4px; }

.captcha-img-wrap img {
    width: 200px;
    height: 60px;
    border: 1.5px solid var(--slate-200);
    border-radius: 9px;
    cursor: pointer;
    transition: border-color 0.18s, box-shadow 0.18s;
    display: block;
}

.captcha-img-wrap img:hover {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(0,74,153,0.15);
}

.captcha-hint {
    font-size: 10px;
    color: var(--slate-400);
    font-weight: 600;
}

.captcha-answer-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 110px;
}

/* CAPTCHA input — uppercase, spaced */
#captchaAnswer {
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ============================================================
   Fetching pulse (AJAX loading indicator)
============================================================ */
.fetching-pulse {
    font-size: 12px;
    font-weight: 600;
    color: var(--blue);
    animation: pulse-anim 1.4s infinite;
    padding: 11px 15px;
}

@keyframes pulse-anim {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

/* ============================================================
   Form Footer buttons
============================================================ */
.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 36px;
}

.btn-reset {
    background: none;
    border: none;
    color: var(--slate-400);
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.18s;
}
.btn-reset:hover { color: #ef4444; }

.btn-submit {
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 10px;
    padding: 13px 30px;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
    box-shadow: 0 4px 14px rgba(0,74,153,0.25);
}
.btn-submit:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,74,153,0.3);
}
.btn-submit:active { transform: translateY(0); }

/* ============================================================
   Required field star indicator
============================================================ */
.req-star {
    color: #ef4444;
    font-size: 12px;
    margin-left: 2px;
    font-weight: 900;
}

/* ============================================================
   Field-level inline error
   JS adds .field-has-error to the .field-group div
============================================================ */
.field-error {
    display: none;
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    margin-top: 5px;
    padding-left: 2px;
    animation: error-fade-in 0.2s ease;
}

.field-has-error .field-error {
    display: block;
}

.field-has-error .field-input,
.field-has-error .field-select {
    border-color: #ef4444;
    background: #fff5f5;
}

.field-has-error .field-input:focus,
.field-has-error .field-select:focus {
    box-shadow: 0 0 0 3px rgba(239,68,68,0.14);
    border-color: #ef4444;
}

@keyframes error-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Validation Error Overlay
   Hidden by default; JS adds .val-overlay--visible to show it
============================================================ */
.val-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    animation: overlay-fade-in 0.22s ease;
}

.val-overlay--visible {
    display: flex;
}

@keyframes overlay-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.val-overlay-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 44px 36px;
    max-width: 420px;
    width: 92%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.18);
    text-align: center;
    animation: card-slide-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-top: 4px solid #ef4444;
}

@keyframes card-slide-in {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.val-overlay-icon {
    margin-bottom: 16px;
}

.val-overlay-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.val-overlay-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    text-align: left;
}

.val-overlay-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    margin-bottom: 8px;
}

.val-overlay-list li::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 900;
    margin-top: 1px;
}

.val-overlay-close {
    background: #004a99;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background 0.18s, transform 0.15s;
    box-shadow: 0 4px 14px rgba(0,74,153,0.2);
}

.val-overlay-close:hover {
    background: #003370;
    transform: translateY(-1px);
}
