/* Land Direct USA Customer Portal - style.css v2.0 (2026-02-22) */

/* ===== RESET & BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; color: #333; line-height: 1.6; }

/* ===== PORTAL NAVIGATION ===== */
.portal-nav { background: linear-gradient(135deg, #1a5d1a 0%, #2e7d32 100%); color: white; position: fixed; top: 0; left: 0; right: 0; z-index: 1000; box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.portal-nav-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; min-height: 60px; }
.portal-brand { display: flex; align-items: center; gap: 12px; }
.portal-logo { height: 36px; }
.portal-title { font-size: 16px; font-weight: 600; opacity: 0.9; }
.portal-links { display: flex; gap: 2px; }
.portal-links a { color: rgba(255,255,255,0.8); text-decoration: none; padding: 18px 16px; font-size: 14px; font-weight: 500; border-bottom: 3px solid transparent; transition: all 0.15s; white-space: nowrap; }
.portal-links a:hover { color: white; background: rgba(255,255,255,0.1); }
.portal-links a.active { color: white; border-bottom-color: white; background: rgba(255,255,255,0.1); }
.portal-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.portal-user-name { color: rgba(255,255,255,0.8); }
.portal-logout { color: rgba(255,255,255,0.7); text-decoration: none; padding: 6px 14px; border: 1px solid rgba(255,255,255,0.3); border-radius: 6px; font-size: 13px; }
.portal-logout:hover { background: rgba(255,255,255,0.15); color: white; }
.portal-mobile-toggle { display: none; background: none; border: none; color: white; font-size: 24px; cursor: pointer; padding: 8px; }

@media (max-width: 900px) {
    .portal-nav-inner { flex-wrap: wrap; }
    .portal-links { display: none; width: 100%; flex-direction: column; padding: 5px 0 10px; }
    .portal-links.show { display: flex; }
    .portal-links a { padding: 12px 16px; border-bottom: none; border-left: 3px solid transparent; }
    .portal-links a.active { border-left-color: white; border-bottom-color: transparent; }
    .portal-mobile-toggle { display: block; }
    .portal-user-name { display: none; }
}

/* ===== MAIN CONTENT (accounts for fixed nav) ===== */
.portal-content { max-width: 1200px; margin: 80px auto 40px; padding: 20px; }

/* ===== LOGIN PAGE ===== */
.login-page { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; background: linear-gradient(135deg, #1a5d1a 0%, #2e7d2e 100%); }
.login-container { width: 100%; max-width: 420px; }
.login-card { background: white; border-radius: 12px; padding: 40px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.login-header { text-align: center; margin-bottom: 30px; }
.login-header h1 { font-size: 24px; margin: 15px 0 5px; color: #1a5d1a; }
.login-header p { color: #666; font-size: 14px; }
.login-help { margin-top: 25px; padding-top: 25px; border-top: 1px solid #eee; text-align: center; font-size: 14px; }
.login-help h3 { font-size: 16px; margin-bottom: 10px; }
.login-help a { color: #1a5d1a; }
.login-footer { margin-top: 20px; text-align: center; color: rgba(255,255,255,0.8); font-size: 14px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #333; font-size: 14px; }
.form-group input, .form-group select { width: 100%; padding: 12px 14px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 15px; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #1a5d1a; box-shadow: 0 0 0 3px rgba(26,93,26,0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ===== BUTTONS ===== */
.btn { padding: 12px 24px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, #1a5d1a 0%, #2e7d32 100%); color: white; }
.btn-primary:hover { background: linear-gradient(135deg, #145214 0%, #256d28 100%); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,93,26,0.3); }
.btn-secondary { background: white; color: #1a5d1a; border: 2px solid #1a5d1a; }
.btn-secondary:hover { background: #f0f8f0; }
.btn-danger { background: #c62828; color: white; }
.btn-danger:hover { background: #a51c1c; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== ALERTS ===== */
.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.alert-warning { background: #fff3e0; color: #e65100; border: 1px solid #ffb74d; }

/* ===== CARDS ===== */
.card { background: white; border-radius: 12px; padding: 25px; margin-bottom: 25px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.card h2 { font-size: 18px; margin-bottom: 15px; color: #333; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 25px; }
.stat-card { background: white; border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.08); transition: transform 0.15s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card h3 { font-size: 13px; color: #666; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #1a5d1a; }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { box-shadow: 0 4px 16px rgba(26,93,26,0.15); }

/* ===== WELCOME CARD ===== */
.welcome-card { background: linear-gradient(135deg, #1a5d1a 0%, #2e7d32 100%); border-radius: 12px; padding: 25px 30px; margin-bottom: 25px; box-shadow: 0 4px 15px rgba(26,93,26,0.2); color: white; }
.welcome-card h2 { color: white; font-size: 22px; margin-bottom: 5px; }
.welcome-card p { color: rgba(255,255,255,0.85); margin: 0; }

/* ===== TABLES ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
th { font-weight: 600; color: #666; font-size: 13px; text-transform: uppercase; letter-spacing: 0.3px; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-blue { background: #e3f2fd; color: #1565c0; }
.badge-orange { background: #fff3e0; color: #ef6c00; }
.badge-red { background: #ffebee; color: #c62828; }
.badge-gray { background: #f5f5f5; color: #757575; }

/* ===== AUTOPAY LOAN CARDS ===== */
.loan-cards { display: grid; gap: 20px; }
.loan-card { background: white; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); overflow: hidden; border: 2px solid #e0e0e0; transition: border-color 0.2s; }
.loan-card:hover { border-color: #1a5d1a; }
.loan-card-header { background: #f8f9fa; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.loan-card-header .apn { font-weight: 700; color: #1a5d1a; font-size: 15px; }
.loan-card-header .location { color: #666; font-size: 13px; }
.loan-card-body { padding: 20px; }
.loan-card-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.loan-card-row:last-child { border-bottom: none; }
.loan-card-row .label { color: #666; }
.loan-card-row .val { font-weight: 600; color: #333; }
.loan-card-actions { padding: 16px 20px; background: #fafafa; border-top: 1px solid #eee; display: flex; gap: 10px; flex-wrap: wrap; }

/* AutoPay status indicators */
.autopay-enrolled { border-color: #2e7d32; }
.autopay-enrolled .loan-card-header { background: #e8f5e9; }
.autopay-not-enrolled .loan-card-header { background: #fff3e0; }

/* ===== CARD INPUT FORM (Accept.js) ===== */
.card-form { max-width: 480px; }
.card-form .form-row { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 500px) { .card-form .form-row { grid-template-columns: 1fr 1fr; } }
.card-input-group { position: relative; }
.card-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #999; font-size: 18px; }
.secure-badge { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; margin-top: 12px; }
.secure-badge::before { content: '🔒'; }

/* ===== PAYMENT RECEIPT ===== */
.receipt { max-width: 480px; margin: 0 auto; }
.receipt-header { text-align: center; padding-bottom: 20px; border-bottom: 2px dashed #e0e0e0; margin-bottom: 20px; }
.receipt-header .check { font-size: 48px; color: #2e7d32; }
.receipt-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.receipt-row .label { color: #666; }
.receipt-row .val { font-weight: 600; }
.receipt-total { font-size: 18px; border-top: 2px solid #333; margin-top: 10px; padding-top: 12px; }
.receipt-total .val { color: #1a5d1a; }

/* ===== MODAL ===== */
.modal-backdrop { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 2000; justify-content: center; align-items: center; padding: 20px; }
.modal-backdrop.show { display: flex; }
.modal { background: white; border-radius: 12px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; padding: 4px; }
.modal-close:hover { color: #333; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #eee; display: flex; gap: 10px; justify-content: flex-end; }

/* ===== LOADING SPINNER ===== */
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid #e0e0e0; border-top-color: #1a5d1a; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PROPERTIES TABLE (existing, kept) ===== */
.props-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.props-table th { background: #f5f5f5; font-size: 11px; white-space: nowrap; padding: 8px 6px; cursor: pointer; user-select: none; }
.props-table th:hover { background: #e8e8e8; }
.props-table th.sortable::after { content: ' ↕'; opacity: 0.3; }
.props-table th.sort-asc::after { content: ' ↑'; opacity: 1; }
.props-table th.sort-desc::after { content: ' ↓'; opacity: 1; }
.props-table td { padding: 8px 6px; border-bottom: 1px solid #eee; }
.loan-id { font-weight: bold; color: #1a5d1a; }
.pay-btn { display: inline-block; background: #1a5d1a; color: white; padding: 5px 10px; border-radius: 5px; text-decoration: none; font-size: 11px; }
.pay-btn:hover { background: #145214; }
.table-wrapper { overflow-x: auto; margin-top: 10px; }
.paid-row { background: #f8fff8; }
.default-row { background: #fff8f8; }
.badge-red { background: #ffebee; color: #c62828; }

/* Column toggles */
.col-toggle-btn { padding: 8px 15px; background: #f5f5f5; border: 1px solid #ddd; border-radius: 5px; cursor: pointer; font-size: 13px; }
.col-toggle-btn:hover { background: #e8e8e8; }
.col-dropdown { position: relative; display: inline-block; }
.col-menu { display: none; position: absolute; top: 100%; right: 0; background: white; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 10px; z-index: 100; min-width: 180px; }
.col-menu.show { display: block; }
.col-menu label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; border-radius: 4px; font-size: 13px; }
.col-menu label:hover { background: #f5f5f5; }
.col-menu input[type="checkbox"] { width: 16px; height: 16px; }
.col-hidden { display: none !important; }

/* Payment options */
.payment-options { background: linear-gradient(135deg, #f8f9fa 0%, #e8f5e9 100%); border: 1px solid #c8e6c9; border-radius: 12px; padding: 20px; margin-top: 20px; }
.payment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.payment-option { background: white; border-radius: 8px; padding: 15px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.payment-option h4 { margin: 10px 0 8px; color: #1a5d1a; font-size: 14px; }
.payment-option p { margin: 5px 0; font-size: 13px; color: #555; line-height: 1.4; }
.payment-option .address { background: #f5f5f5; padding: 10px; border-radius: 5px; font-size: 12px; text-align: left; }
.payment-icon { font-size: 28px; }
.payment-link { display: inline-block; background: #1a5d1a; color: white; padding: 8px 15px; border-radius: 5px; text-decoration: none; font-size: 13px; margin-top: 5px; }
.payment-link:hover { background: #145214; }

/* Pagination */
.apn-search { padding: 10px 15px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; width: 280px; }
.apn-search:focus { outline: none; border-color: #1a5d1a; box-shadow: 0 0 0 2px rgba(26,93,26,0.1); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 20px; padding-top: 15px; border-top: 1px solid #eee; }
.page-btn { padding: 8px 16px; background: #1a5d1a; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 13px; }
.page-btn:hover { background: #145214; }
.page-btn:disabled { background: #ccc; cursor: not-allowed; }
.page-info { font-size: 13px; color: #666; min-width: 140px; text-align: center; }
.no-results { text-align: center; padding: 20px; color: #666; font-style: italic; }

/* ===== FOOTER ===== */
.portal-footer { text-align: center; padding: 20px; margin-top: 30px; border-top: 1px solid #e0e0e0; color: #666; font-size: 0.85rem; }
.portal-footer a { color: #2e7d32; text-decoration: none; }
.portal-footer a:hover { text-decoration: underline; }

/* ===== ACCOUNT PAGE ===== */
.account-form { max-width: 600px; margin: 0 auto; }
.form-section { background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 25px; margin-bottom: 20px; }
.form-section h3 { margin: 0 0 20px; color: #1a5d1a; font-size: 18px; border-bottom: 2px solid #e8f5e9; padding-bottom: 10px; }
.name-display { background: #f5f5f5; border: 2px solid #e0e0e0; border-radius: 8px; padding: 12px 14px; color: #666; }
.hint { font-size: 12px; color: #888; margin-top: 5px; }
.warning-box { background: #fff3e0; border: 1px solid #ffb74d; border-radius: 8px; padding: 14px; margin-top: 10px; }
.warning-box strong { color: #e65100; }
.current-pin { background: #e3f2fd; border-radius: 6px; padding: 10px 14px; margin-top: 8px; font-size: 13px; color: #1565c0; }
