/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1a1a1a; background: #f8f9fa; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; font-size: 15px; font-weight: 600; transition: all 0.15s; text-decoration: none; }
.btn:hover { filter: brightness(0.92); }
.btn-primary { background: #2563eb; color: #fff; }
.btn-outline { background: transparent; border: 2px solid #2563eb; color: #2563eb; }
.btn-ghost { background: transparent; color: #555; }
.btn-ghost:hover { background: #f0f0f0; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.checkbox-label { display:flex; align-items:flex-start; gap:10px; font-size:14px; cursor:pointer; }
.checkbox-label input[type="checkbox"] { margin-top:2px; flex-shrink:0; width:16px; height:16px; }
.btn-lg { padding: 14px 32px; font-size: 17px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* === NAV === */
.nav { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 24px; height: 60px; display: flex; align-items: center; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1100px; margin: 0 auto; }
.logo { font-size: 20px; font-weight: 700; }

/* === LANDING === */
.hero { text-align: center; padding: 80px 24px 60px; max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: 48px; font-weight: 800; line-height: 1.15; color: #111; }
.hero .subtitle { font-size: 20px; color: #555; margin: 20px 0 36px; }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hero-note { font-size: 13px; color: #888; }

.features { padding: 40px 24px 60px; max-width: 1100px; margin: 0 auto; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature-card { background: #fff; border-radius: 12px; padding: 28px 24px; border: 1px solid #e5e7eb; }
.feature-icon { font-size: 32px; display: block; margin-bottom: 12px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: #666; line-height: 1.6; }

.pricing { padding: 40px 24px 60px; max-width: 1100px; margin: 0 auto; text-align: center; }
.pricing h2 { font-size: 32px; margin-bottom: 36px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.pricing-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 32px 24px; position: relative; }
.pricing-card.featured { border-color: #2563eb; border-width: 2px; }
.badge { background: #2563eb; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.pricing-card h3 { font-size: 20px; margin-bottom: 8px; }
.price { font-size: 36px; font-weight: 800; color: #111; margin-bottom: 20px; }
.price span { font-size: 16px; font-weight: 400; color: #888; }
.pricing-card ul { list-style: none; text-align: left; margin-bottom: 24px; }
.pricing-card ul li { padding: 6px 0; font-size: 14px; color: #555; }
.pricing-card ul li::before { content: "✓ "; color: #22c55e; font-weight: 700; }

.disclaimer-banner { background: #fef9c3; border-top: 1px solid #fde047; padding: 16px 24px; text-align: center; font-size: 13px; color: #854d0e; }

footer { background: #111; color: #aaa; padding: 24px; margin-top: 60px; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
footer nav { display: flex; gap: 20px; }
footer nav a { color: #aaa; font-size: 13px; }
footer nav a:hover { color: #fff; }

/* === AUTH === */
.auth-page { background: #f8f9fa; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-container { background: #fff; border-radius: 16px; padding: 40px; max-width: 480px; width: 100%; border: 1px solid #e5e7eb; }
.logo-link { font-size: 20px; font-weight: 700; display: block; margin-bottom: 24px; text-decoration: none; color: #1a1a1a; }
.auth-container h1 { font-size: 26px; margin-bottom: 8px; }
.auth-sub { color: #666; font-size: 15px; margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 600; color: #333; }
.form-group input[type=text], .form-group input[type=email], .form-group input[type=datetime-local], .form-group select, .form-group textarea {
  border: 1px solid #d1d5db; border-radius: 8px; padding: 10px 14px; font-size: 15px; outline: none; width: 100%;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.req { color: #ef4444; }
.field-hint { font-size: 12px; color: #888; }

.role-picker, .category-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.role-option, .cat-option { display: flex; align-items: center; gap: 8px; cursor: pointer; border: 2px solid #e5e7eb; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600; transition: all 0.15s; }
.role-option:has(input:checked), .cat-option:has(input:checked) { border-color: #2563eb; background: #eff6ff; color: #2563eb; }
.role-option input, .cat-option input { display: none; }

.agreements { display: flex; flex-direction: column; gap: 12px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: #444; cursor: pointer; line-height: 1.5; }
.checkbox-label input[type=checkbox] { margin-top: 2px; width: 16px; height: 16px; flex-shrink: 0; accent-color: #2563eb; }

/* === E-SIGNATURE === */
.esign-block { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.esign-terms { font-size: 13px; color: #555; line-height: 1.7; }
.esign-line { display: flex; align-items: center; gap: 10px; border-top: 2px solid #1a1a1a; padding-top: 8px; margin-top: 4px; min-height: 40px; }
.esign-x { font-size: 18px; color: #1a1a1a; font-weight: 700; }
.esign-preview { font-family: 'Georgia', cursive; font-size: 22px; color: #1a1a1a; font-style: italic; letter-spacing: 0.03em; }

.form-error { background: #fee2e2; color: #b91c1c; border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: #666; }

.success-message { text-align: center; padding: 20px 0; }
.success-icon { font-size: 48px; display: block; margin-bottom: 16px; }
.success-message h2 { font-size: 24px; margin-bottom: 12px; }
.success-message p { color: #555; line-height: 1.7; }
.success-message .small { font-size: 13px; color: #999; margin-top: 12px; }

/* === APP LAYOUT === */
.app-page { background: #f3f4f6; min-height: 100vh; }
.app-header { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.header-right { display: flex; align-items: center; gap: 10px; }
.plan-badge { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; }

.app-body { display: flex; height: calc(100vh - 60px); }
.sidebar { width: 220px; background: #fff; border-right: 1px solid #e5e7eb; padding: 20px 16px; flex-shrink: 0; overflow-y: auto; }
.sidebar-section { margin-bottom: 28px; }
.sidebar-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #9ca3af; letter-spacing: 0.08em; margin-bottom: 8px; }
.filter-btn { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: #555; cursor: pointer; margin-bottom: 2px; }
.filter-btn:hover { background: #f3f4f6; }
.filter-btn.active { background: #eff6ff; color: #2563eb; font-weight: 600; }

.log-feed { flex: 1; overflow-y: auto; padding: 24px; }
#log-list { display: flex; flex-direction: column; gap: 12px; }
.log-card { background: #fff; border-radius: 10px; padding: 18px 20px; border: 1px solid #e5e7eb; }
.log-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.log-card-title { font-size: 16px; font-weight: 600; }
.log-card-cat { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.cat-communication { background: #dbeafe; color: #1e40af; }
.cat-maintenance { background: #fef3c7; color: #92400e; }
.cat-payment { background: #dcfce7; color: #166534; }
.cat-other { background: #f3f4f6; color: #374151; }
.log-card-meta { font-size: 12px; color: #9ca3af; margin-top: 6px; }
.log-card-desc { font-size: 14px; color: #555; margin-top: 10px; line-height: 1.6; }
.log-card-photos { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.log-photo-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid #e5e7eb; }
.log-card-footer { margin-top: 12px; display: flex; gap: 10px; }
.log-delete-btn { font-size: 13px; color: #ef4444; background: none; border: none; cursor: pointer; }
.log-delete-btn:hover { text-decoration: underline; }

.empty-state { text-align: center; padding: 80px 24px; color: #9ca3af; }
.empty-state span { font-size: 48px; display: block; margin-bottom: 16px; }
.upgrade-banner { background: #fef9c3; border: 1px solid #fde047; border-radius: 10px; padding: 16px 20px; font-size: 14px; color: #854d0e; display: flex; align-items: center; gap: 12px; }

/* === MODAL === */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-box { background: #fff; border-radius: 16px; padding: 32px; max-width: 560px; width: 100%; position: relative; z-index: 1; max-height: 90vh; overflow-y: auto; }
.modal-box h2 { font-size: 22px; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }

#property-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.property-item { font-size: 13px; color: #555; padding: 4px 8px; }

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .hero h1 { font-size: 32px; }
  .app-body { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e5e7eb; padding: 12px 16px; }
  .filter-btn { display: inline-flex; }
  .pricing-grid { grid-template-columns: 1fr; }
}
