/* ============================================================
   PROPOSEAI — style.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #F7F7F5;
  --surface:   #FFFFFF;
  --border:    #E4E4E0;
  --text:      #111111;
  --muted:     #6B6B66;
  --accent:    #4F46E5;
  --accent-bg: #EEF2FF;
  --success:   #16A34A;
  --warn:      #D97706;
  --radius:    10px;
  --radius-sm: 6px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.6; }

/* ---- AUTH PAGE ---- */
.auth-page { display: flex; min-height: 100vh; }

.auth-container { width: 420px; min-width: 320px; padding: 48px 40px; background: var(--surface); display: flex; flex-direction: column; justify-content: center; }

.auth-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 32px; }
.brand-dot  { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.brand-name { font-size: 16px; font-weight: 600; color: var(--text); }

.auth-title { font-size: 24px; font-weight: 600; margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: var(--muted); margin-bottom: 28px; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-switch { margin-top: 20px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 500; }

.auth-hero { flex: 1; background: var(--accent); padding: 48px; display: flex; align-items: center; justify-content: center; }
.hero-content h2 { font-size: 32px; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: 16px; }
.hero-content p  { font-size: 16px; color: rgba(255,255,255,0.8); margin-bottom: 32px; }
.hero-stats { display: flex; gap: 24px; }
.hstat { display: flex; flex-direction: column; gap: 2px; }
.hstat strong { font-size: 22px; font-weight: 700; color: #fff; }
.hstat span   { font-size: 12px; color: rgba(255,255,255,0.7); }

/* ---- FORM ELEMENTS ---- */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--muted); }

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  transition: border-color .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
  font-family: inherit;
}
.btn:hover    { background: var(--bg); }
.btn-primary  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #4338CA; border-color: #4338CA; }
.btn-ghost    { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); }
.btn-full     { width: 100%; }
.btn-sm       { padding: 5px 10px; font-size: 12px; }

/* ---- ALERTS ---- */
.alert         { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warn    { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert a { color: var(--accent); font-weight: 500; }

/* ---- NAVBAR ---- */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-links  { display: flex; align-items: center; gap: 12px; }
.nav-user   { font-size: 13px; color: var(--muted); }
.nav-logout { font-size: 13px; color: var(--muted); text-decoration: none; }
.nav-logout:hover { color: var(--text); }
.nav-plan { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; }
.plan-free     { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.plan-starter  { background: var(--accent-bg); color: var(--accent); }
.plan-pro      { background: #FEF3C7; color: #92400E; }
.plan-agency   { background: #F0FDF4; color: #166534; }

/* ---- APP LAYOUT ---- */
.app-page { min-height: 100vh; }

.app-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: 0;
  min-height: calc(100vh - 53px);
}

.form-panel {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}

.preview-panel { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.panel-title { font-size: 15px; font-weight: 600; color: var(--text); }

.preview-header { display: flex; align-items: center; justify-content: space-between; }
.preview-actions { display: flex; gap: 8px; }

.preview-placeholder {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--muted); text-align: center; gap: 10px;
  border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 48px;
}
.placeholder-icon { font-size: 28px; color: var(--border); }

.preview-loading {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; color: var(--muted);
}
.loading-spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- PROPOSAL DOC ---- */
.proposal-doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; }
.proposal-doc h2 { font-size: 18px; margin-bottom: 10px; color: var(--text); }
.proposal-doc h3 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; color: var(--text); }
.proposal-doc p  { margin-bottom: 12px; color: #333; line-height: 1.7; }
.proposal-doc ul { margin: 0 0 12px 18px; }
.proposal-doc li { margin-bottom: 4px; color: #333; }
.proposal-doc hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.proposal-doc strong { font-weight: 600; color: var(--text); }

.proposal-footer { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ---- TONE PILLS ---- */
.tone-pills { display: flex; gap: 8px; }
.tone-pill {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); color: var(--muted); cursor: pointer;
  transition: all .15s; user-select: none;
}
.tone-pill.active, .tone-pill:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

/* ---- USAGE BAR ---- */
.usage-bar-wrap { display: flex; flex-direction: column; gap: 6px; }
.usage-label    { font-size: 11px; color: var(--muted); }
.usage-bar      { height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; }
.usage-fill     { height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }

/* ---- HISTORY ---- */
.history-section { padding: 24px; border-top: 1px solid var(--border); }
.history-title   { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.history-grid    { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.history-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.hcard-top    { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.hcard-client { font-size: 13px; font-weight: 600; color: var(--text); }
.hcard-type   { font-size: 11px; color: var(--muted); background: var(--bg); padding: 2px 7px; border-radius: 20px; }
.hcard-meta   { display: flex; gap: 8px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.hcard-date   { font-size: 11px; color: var(--muted); }

/* ---- PROPOSAL PAGE ---- */
.proposal-page { max-width: 720px; margin: 32px auto; padding: 0 24px; }
.proposal-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.meta-tag  { font-size: 12px; background: var(--accent-bg); color: var(--accent); padding: 3px 10px; border-radius: 20px; }
.meta-date { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .auth-hero { display: none; }
  .auth-container { width: 100%; padding: 32px 24px; }
  .app-layout { grid-template-columns: 1fr; }
  .form-panel { border-right: none; border-bottom: 1px solid var(--border); }
}
