/* ============================================================
   FarmCard Pro — farmer-form.css  (v2.1)
   Modernized green theme, wide desktop layout, land table.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary-green: #2E7D32;
    --primary-green-light: #4CAF50;
    --primary-dark: #1B5E20;
    --light-green: #E8F5E9;
    --mint: #F1F8F2;
    --orange: #FF9800;
    --orange-dark: #E55A2B;
    --text-primary: #1A1A1A;
    --text-secondary: #5F6B5F;
    --border-color: #DDE5DD;
    --error-color: #E53935;
    --success-color: #2E7D32;
    --telegram-blue: #0088cc;
    --youtube-red: #FF0000;
    --csc-blue: #0A58CA;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.16);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font);
    background: linear-gradient(160deg, #f6f9f6 0%, #e8f5e9 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

input, textarea, select { -webkit-user-select: text; user-select: text; }

.container { max-width: 1140px; margin: 0 auto; padding: 24px; }

/* Header */
.header { background: white; border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 32px 28px; text-align: center; margin-bottom: 22px; border-top: 4px solid var(--primary-green); }
.header h1 { color: var(--primary-green); font-size: 2.1rem; margin-bottom: 6px; letter-spacing: -0.5px; }
.header p { color: var(--text-secondary); font-size: 1.05rem; }

/* Social buttons */
.social-buttons { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.social-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 50px; text-decoration: none; font-weight: 600; font-size: 15px; transition: all .25s ease; box-shadow: var(--shadow-sm); color: #fff; }
.social-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.telegram-btn { background: var(--telegram-blue); }
.tutorial-btn { background: var(--youtube-red); }
.csc-btn { background: linear-gradient(135deg, #0A58CA, #084298); text-transform: uppercase; font-weight: 700; }
.kamgar-btn { background: linear-gradient(45deg, #ff6b00, #ffcc00); text-transform: uppercase; font-weight: 700; }

/* Warning box */
.warning-box { background-color: #fff8e1; color: #8a6d00; padding: 14px 18px; text-align: center; font-weight: 600; font-size: .95em; border: 1px solid #ffe082; margin-bottom: 22px; border-radius: var(--radius-sm); }

/* Design selector */
.design-selector { margin-bottom: 22px; }
.design-selector-title { font-size: 1.15rem; color: var(--primary-dark); margin-bottom: 14px; text-align: center; font-weight: 700; }
.design-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.design-card { background: #fff; border: 2px solid var(--border-color); border-radius: var(--radius); padding: 20px 20px 20px 44px; cursor: pointer; transition: all .2s ease; position: relative; }
.design-card:hover { border-color: var(--primary-green-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.design-card.selected { border-color: var(--primary-green); box-shadow: 0 0 0 3px rgba(46,125,50,.15); background: var(--mint); }
.design-card .design-radio { position: absolute; top: 22px; left: 16px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-color); transition: all .2s; }
.design-card.selected .design-radio { border-color: var(--primary-green); background: var(--primary-green); box-shadow: inset 0 0 0 3px #fff; }
.design-card h3 { color: var(--primary-dark); font-size: 1.1rem; margin-bottom: 4px; }
.design-card .design-sub { color: var(--text-secondary); font-size: .88rem; min-height: 36px; }
.view-sample-btn { margin-top: 12px; background: #fff; color: var(--primary-green); border: 1.5px solid var(--primary-green); border-radius: 50px; padding: 7px 16px; font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .2s; }
.view-sample-btn:hover { background: var(--light-green); }

/* Form card */
.form-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 32px; margin-bottom: 22px; }

/* Desktop two-column section layout */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.form-grid .full-col { grid-column: 1 / -1; }

.form-section { margin-bottom: 28px; }
.section-title { font-size: 1.2rem; color: var(--primary-green); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--light-green); font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.form-group { margin-bottom: 18px; }
.form-group.full-width { grid-column: 1 / -1; }
label { display: block; font-weight: 600; margin-bottom: 7px; color: var(--text-primary); font-size: .95rem; }
.required { color: var(--error-color); }

input, select, textarea { width: 100%; padding: 12px 14px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: 16px; transition: all .2s ease; background: #fff; font-family: var(--font); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-green); box-shadow: 0 0 0 3px rgba(46,125,50,.12); }

.hint-text { color: var(--text-secondary); font-size: 13px; margin-top: 5px; }
.error-message { color: var(--error-color); font-size: 13px; margin-top: 5px; display: none; }
.error-message.show { display: block; }

/* DOB dropdowns */
.dob-selects { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; }
.dob-selects select { cursor: pointer; padding: 12px 10px; }

/* Radio */
.radio-group { display: flex; gap: 18px; margin-top: 8px; }
.radio-item { display: flex; align-items: center; gap: 8px; }
.radio-item input[type="radio"] { width: auto; }

/* Photo upload */
.photo-upload-container { border: 2px dashed var(--border-color); border-radius: var(--radius); padding: 26px; text-align: center; background: var(--mint); margin-bottom: 18px; }
.photo-upload-container.dragover { border-color: var(--primary-green); background: rgba(76,175,80,.08); }
.photo-preview-box { width: 160px; height: 200px; margin: 18px auto; background: #fff; border: 1px solid var(--border-color); border-radius: 6px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.photo-preview { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-placeholder { color: var(--text-secondary); font-size: 56px; }
.upload-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* Buttons */
.btn { padding: 12px 22px; border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s ease; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--primary-green); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-secondary { background: #fff; color: var(--primary-green); border: 2px solid var(--primary-green); }
.btn-secondary:hover { background: var(--light-green); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Land table */
#landSection { display: none; }
#landSection.active { display: block; }
.land-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.land-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.land-table thead th { background: var(--primary-green); color: #fff; font-size: .82rem; font-weight: 600; text-align: left; padding: 11px 10px; white-space: nowrap; }
.land-table tbody td { padding: 8px; border-bottom: 1px solid var(--border-color); vertical-align: top; }
.land-table tbody tr:last-child td { border-bottom: none; }
.land-table input { padding: 9px 10px; font-size: 14px; }
.land-table .col-actions { width: 70px; white-space: nowrap; text-align: center; }
.survey-cell { display: flex; flex-direction: column; gap: 6px; }
.survey-entry { display: flex; gap: 6px; align-items: center; }
.survey-entry input { flex: 1; }
.icon-btn { border: none; border-radius: 7px; width: 32px; height: 36px; cursor: pointer; font-size: 1rem; line-height: 1; flex-shrink: 0; transition: all .15s; }
.icon-btn.add { background: var(--light-green); color: var(--primary-dark); }
.icon-btn.add:hover { background: #c8e6c9; }
.icon-btn.remove { background: #ffebee; color: var(--error-color); }
.icon-btn.remove:hover { background: #ffcdd2; }
.add-row-btn { background: #fff; color: var(--primary-green); border: 1.5px solid var(--primary-green); border-radius: var(--radius-sm); padding: 11px 18px; font-size: .92rem; font-weight: 600; cursor: pointer; transition: all .2s; margin-top: 14px; }
.add-row-btn:hover { background: var(--light-green); }

/* Payment */
.payment-info { background: var(--light-green); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; text-align: center; }
.payment-amount { font-size: 2.2rem; color: var(--primary-green); font-weight: 700; margin: 8px 0; }
.coin-icon { width: 1em; vertical-align: middle; }

/* Coin promo (logged-out only, below submit) */
.coin-promo-box { background: linear-gradient(135deg,#FFF8E1,#FFE5CC); border: 2px dashed var(--orange); padding: 18px 20px; border-radius: 12px; margin: 22px auto 0; max-width: 560px; text-align: center; }
.coin-promo-box h4 { color: var(--orange-dark); margin-bottom: 8px; }
.btn-coin-action { display: inline-block; padding: 10px 20px; border-radius: 25px; font-weight: 600; text-decoration: none; font-size: .92em; transition: all .25s; }
.btn-coin-fill { background: linear-gradient(135deg,var(--orange),var(--orange-dark)); color: #fff; }
.btn-coin-outline { background: #fff; color: var(--orange-dark); border: 2px solid var(--orange-dark); }
.coin-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Submit */
.submit-section { text-align: center; margin-top: 26px; }
.submit-btn { background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-dark) 100%); color: #fff; padding: 15px 48px; font-size: 17px; border: none; border-radius: 50px; cursor: pointer; transition: all .25s ease; box-shadow: 0 4px 15px rgba(46,125,50,.3); }
.submit-btn:hover { transform: translateY(-3px); box-shadow: 0 6px 22px rgba(46,125,50,.4); }
.submit-btn:disabled { opacity: .6; transform: none; }

/* Spinner */
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.3); border-radius: 50%; border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Support / status */
.support-section { text-align: center; margin: 26px 0; }
.support-btn { background: var(--orange); color: #fff; padding: 12px 28px; border: none; border-radius: 25px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; transition: all .25s; }
.support-btn:hover { background: #F57C00; transform: translateY(-2px); }
.status-link { text-align: center; margin-top: 18px; }
.status-link a { color: var(--primary-green); text-decoration: none; font-weight: 600; }

/* Generic modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 1000; }
.modal-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #fff; padding: 28px; border-radius: var(--radius); max-width: 92%; max-height: 92%; overflow: auto; }

/* Cropper */
.crop-container { position: relative; width: 360px; height: 450px; margin: 18px auto; border: 2px solid var(--border-color); overflow: hidden; background: #2a2a2a; touch-action: none; cursor: move; }
.crop-canvas { position: absolute; top: 0; left: 0; }
.crop-frame { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 160px; height: 200px; border: 2px solid var(--primary-green-light); pointer-events: none; box-shadow: 0 0 0 2000px rgba(0,0,0,.55); }
.crop-controls { text-align: center; margin-top: 16px; }
.zoom-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.zoom-slider { width: 200px; }

/* Sample modal */
.sample-img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border-color); }

/* Land preview modal */
.preview-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 2500; overflow-y: auto; }
.preview-content { background: #fff; margin: 40px auto; padding: 28px; border-radius: var(--radius); max-width: 640px; width: 94%; }
.preview-content h2 { color: var(--primary-green); margin-bottom: 6px; }
.preview-note { color: var(--text-secondary); font-size: .9rem; margin-bottom: 16px; }
.preview-cap-warn { background: #fff8e1; border: 1px solid #ffe082; color: #8a6d00; padding: 10px 14px; border-radius: 8px; font-size: .9rem; margin-bottom: 14px; }
.preview-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--border-color); border-radius: var(--radius-sm); margin-bottom: 8px; }
.preview-row.excluded { opacity: .5; background: #fafafa; }
.preview-row input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; }
.preview-row .pr-info { flex: 1; font-size: .92rem; }
.preview-row .pr-info .pr-village { font-weight: 700; color: var(--primary-dark); }
.preview-row .pr-info .pr-detail { color: var(--text-secondary); font-size: .85rem; }
.preview-row .pr-move { display: flex; flex-direction: column; gap: 3px; }
.preview-row .pr-move button { background: var(--light-green); border: none; border-radius: 6px; width: 30px; height: 22px; cursor: pointer; font-size: .8rem; line-height: 1; color: var(--primary-dark); }
.preview-row .pr-move button:disabled { opacity: .35; cursor: not-allowed; }
.preview-buttons { display: flex; gap: 12px; justify-content: flex-end; margin-top: 18px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Disclaimer popup */
.disclaimer-popup-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 10000; overflow-y: auto; }
.disclaimer-popup { position: relative; margin: 20px auto; background: #fff; border-radius: var(--radius); max-width: 680px; width: 95%; box-shadow: var(--shadow-lg); }
.warning-header { background: #FFF3E0; padding: 20px; border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; gap: 14px; border-bottom: 3px solid #FF5722; }
.warning-header h2 { color: #D32F2F; font-size: 22px; margin: 0; font-weight: 700; }
.popup-content { padding: 28px; }
.main-warning { font-size: 20px; text-align: center; color: #D32F2F; margin-bottom: 22px; font-weight: 600; }
.disclaimer-box { background: #FFF8E1; border: 2px solid #FFC107; border-radius: 8px; padding: 20px; margin-bottom: 18px; }
.disclaimer-box h3 { color: #F57C00; font-size: 17px; margin-bottom: 12px; }
.disclaimer-list { margin: 12px 0; padding-left: 20px; }
.disclaimer-list li { margin: 9px 0; line-height: 1.55; color: #424242; }
.warning-alert { background: #FFEBEE; border: 2px solid #EF5350; border-radius: 6px; padding: 14px; margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; }
.warning-alert p { margin: 0; color: #C62828; line-height: 1.5; }
.farmer-notice { background: #E3F2FD; border: 2px solid #2196F3; border-radius: 8px; padding: 14px; }
.farmer-notice h3 { color: #1565C0; font-size: 17px; margin-bottom: 8px; }
.farmer-notice p { color: #0D47A1; margin: 0; }
.popup-footer { background: #F5F5F5; padding: 20px; border-radius: 0 0 var(--radius) var(--radius); border-top: 1px solid #E0E0E0; }
.understand-checkbox { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; cursor: pointer; font-size: 15px; color: #424242; }
.understand-checkbox input { width: 18px; height: 18px; }
.popup-buttons { display: flex; gap: 14px; justify-content: center; }
.btn-accept { background: var(--primary-green-light); color: #fff; padding: 12px 36px; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-accept:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-2px); }
.btn-accept:disabled { background: #CCC; cursor: not-allowed; }
.btn-reject { background: var(--error-color); color: #fff; padding: 12px 36px; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-reject:hover { background: #C62828; transform: translateY(-2px); }

/* Footer */
.site-footer { background-color: #222; color: #fff; padding: 40px 0 20px; margin-top: 50px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer-cols { display: flex; flex-wrap: wrap; margin-bottom: 30px; gap: 40px; }
.footer-col { flex: 1; min-width: 200px; margin-bottom: 20px; }
.footer-col h4 { color: #fff; font-size: 17px; margin: 0 0 14px; font-weight: 600; }
.footer-col p, .footer-col a { color: #bbb; font-size: 14px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-pay { background-color: #333; padding: 20px; border-radius: 6px; text-align: center; margin-bottom: 30px; }
.footer-pay-label { color: #bbb; font-size: 12px; text-transform: uppercase; margin-bottom: 14px; letter-spacing: 1px; }
.footer-pay-methods { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.footer-pay-methods span { background-color: #444; color: #fff; padding: 5px 15px; border-radius: 3px; font-size: 13px; }
.footer-bottom { border-top: 1px solid #444; padding-top: 20px; text-align: center; }
.footer-bottom p { color: #bbb; font-size: 14px; margin: 0 0 10px; }
.footer-links { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.footer-links a { color: #bbb; text-decoration: none; font-size: 13px; }
.footer-links span { color: #555; }

/* Responsive */
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .design-cards { grid-template-columns: 1fr; }
    .form-card { padding: 22px; }
    .header h1 { font-size: 1.7rem; }
    .social-buttons { flex-direction: column; align-items: center; }
    .social-btn { width: 100%; max-width: 320px; justify-content: center; }
    .crop-container { width: 90vw; max-width: 340px; height: 420px; }
    .popup-buttons { flex-direction: column; }
    .popup-buttons button { width: 100%; }
    .preview-content { margin: 20px auto; }
}