/* =============================================
   AutoFlow — style.css
   Theme: Warm cream / sand + orange-amber accent
   All styles in one place
   ============================================= */

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #faf7f2;
  color: #2c2416;
  min-height: 100vh;
  line-height: 1.6;
}

a { color: #c2650a; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.center    { text-align: center; }

/* --- Navbar --- */
nav {
  background: #fff8ee;
  border-bottom: 1px solid #e8dcc8;
  padding: 14px 0;
}
nav .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
nav .logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #c2650a;
  letter-spacing: -0.5px;
}
nav .logo span { color: #2c2416; }
nav ul { list-style: none; display: flex; gap: 8px; }
nav ul a {
  padding: 8px 14px;
  border-radius: 6px;
  color: #6b5744;
  font-size: 0.9rem;
  transition: background 0.15s;
}
nav ul a:hover { background: #f0e6d6; text-decoration: none; }
nav ul a.btn-nav {
  background: #c2650a;
  color: #fff;
  font-weight: 600;
}
nav ul a.btn-nav:hover { background: #a3540a; }

/* --- Hero (landing) --- */
.hero {
  padding: 90px 24px 60px;
  text-align: center;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 18px;
  color: #1e1609;
}
.hero h1 span { color: #c2650a; }
.hero p {
  font-size: 1.15rem;
  color: #7a6452;
  max-width: 520px;
  margin: 0 auto 32px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 11px 26px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.btn-primary  { background: #c2650a; color: #fff; }
.btn-primary:hover  { background: #a3540a; text-decoration: none; }
.btn-outline  { background: transparent; color: #c2650a; border: 1px solid #c2650a; }
.btn-outline:hover  { background: #c2650a14; text-decoration: none; }
.btn-danger   { background: #c0392b; color: #fff; }
.btn-danger:hover   { opacity: 0.85; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Cards --- */
.card {
  background: #fff8ee;
  border: 1px solid #e8dcc8;
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
}
.card h2 { font-size: 1.1rem; margin-bottom: 6px; color: #1e1609; }
.card p  { color: #7a6452; font-size: 0.9rem; }

/* --- Features grid (landing) --- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  padding: 0 24px 60px;
  max-width: 1100px;
  margin: 0 auto;
}
.feature-card {
  background: #fff8ee;
  border: 1px solid #e8dcc8;
  border-radius: 12px;
  padding: 28px 24px;
}
.feature-card .icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1rem; margin-bottom: 6px; color: #1e1609; }
.feature-card p  { color: #7a6452; font-size: 0.88rem; }

/* --- Auth forms --- */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.auth-box {
  background: #fff8ee;
  border: 1px solid #e8dcc8;
  border-radius: 14px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px #c2650a0f;
}
.auth-box h2 { font-size: 1.5rem; margin-bottom: 6px; color: #1e1609; }
.auth-box .sub { color: #7a6452; font-size: 0.9rem; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #7a6452;
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: #faf7f2;
  border: 1px solid #d9cbb8;
  border-radius: 8px;
  padding: 10px 14px;
  color: #2c2416;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #c2650a; }
.form-group textarea { resize: vertical; min-height: 80px; }

/* --- Alerts / Flash --- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.alert-error   { background: #fdf0ee; border: 1px solid #e07060; color: #a33020; }
.alert-success { background: #fef6e8; border: 1px solid #c2650a; color: #8a4508; }
.alert-info    { background: #f0f4fe; border: 1px solid #8aaadf; color: #2a4a80; }

/* --- Dashboard layout --- */
.dash-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1e1609;
}
.page-sub { color: #7a6452; font-size: 0.92rem; margin-bottom: 30px; }

/* Stats row */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: #fff8ee;
  border: 1px solid #e8dcc8;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}
.stat-card .num { font-size: 2rem; font-weight: 800; color: #c2650a; }
.stat-card .lbl { font-size: 0.82rem; color: #a08060; margin-top: 2px; }

/* --- Flows table --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; padding: 10px 14px; color: #a08060; font-weight: 600; border-bottom: 1px solid #e8dcc8; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
td { padding: 12px 14px; border-bottom: 1px solid #f0e6d6; vertical-align: middle; color: #2c2416; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fdf3e6; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green  { background: #fef3e2; color: #c2650a; border: 1px solid #e8c090; }
.badge-gray   { background: #f0e8dc; color: #a08060; border: 1px solid #d9cbb8; }
.badge-yellow { background: #fefbe8; color: #9a7a10; border: 1px solid #ddd080; }

/* --- Flow editor --- */
.flow-editor { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }
.panel {
  background: #fff8ee;
  border: 1px solid #e8dcc8;
  border-radius: 12px;
  padding: 20px;
}
.panel h3 { font-size: 0.85rem; color: #a08060; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }

.connector-list { display: flex; flex-direction: column; gap: 8px; max-height: 500px; overflow-y: auto; }
.connector-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: #faf7f2;
  border: 1px solid #d9cbb8;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #3d2e1e;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.connector-item:hover { border-color: #c2650a; background: #fef3e2; }
.connector-item.selected { border-color: #c2650a; background: #fef3e2; }
.connector-item .ico { font-size: 1.2rem; width: 26px; text-align: center; }

/* flow canvas */
.flow-canvas { display: flex; flex-direction: column; gap: 12px; }
.flow-step {
  background: #faf7f2;
  border: 1px solid #d9cbb8;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}
.flow-step .step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #fef3e2;
  border: 1px solid #e8c090;
  color: #c2650a;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.flow-step .step-body { flex: 1; }
.flow-step .step-body strong { font-size: 0.9rem; display: block; color: #1e1609; }
.flow-step .step-body span { font-size: 0.8rem; color: #a08060; }
.step-arrow { text-align: center; color: #d9cbb8; font-size: 1.2rem; }

/* --- Billing --- */
.billing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.request-packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.pkg {
  background: #faf7f2;
  border: 2px solid #d9cbb8;
  border-radius: 10px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pkg:hover, .pkg.selected { border-color: #c2650a; background: #fef3e2; }
.pkg .credits { font-size: 1.5rem; font-weight: 800; color: #c2650a; }
.pkg .price   { font-size: 0.85rem; color: #7a6452; margin-top: 2px; }
.pkg .bonus   { font-size: 0.75rem; color: #9a7a10; margin-top: 4px; font-weight: 600; }

/* Transactions list */
.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #faf7f2;
  border: 1px solid #e8dcc8;
  border-radius: 8px;
  font-size: 0.85rem;
}
.tx-row .tx-label { color: #3d2e1e; }
.tx-row .tx-date  { color: #a08060; font-size: 0.78rem; }
.tx-row .tx-amount.plus  { color: #c2650a; font-weight: 700; }
.tx-row .tx-amount.minus { color: #c0392b; font-weight: 700; }

/* API connectors showcase */
.conn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.conn-badge {
  background: #fff8ee;
  border: 1px solid #e8dcc8;
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  font-size: 0.78rem;
  color: #7a6452;
  transition: border-color 0.15s, background 0.15s;
}
.conn-badge:hover { border-color: #c2650a88; background: #fef3e2; }
.conn-badge .ico { display: block; font-size: 1.4rem; margin-bottom: 4px; }

/* --- Footer --- */
footer {
  background: #fff8ee;
  border-top: 1px solid #e8dcc8;
  padding: 40px 24px 28px;
  margin-top: 60px;
}
footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
footer .footer-brand .logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #c2650a;
  display: inline-block;
  margin-bottom: 10px;
}
footer .footer-brand .logo span { color: #2c2416; }
footer .footer-brand p {
  font-size: 0.85rem;
  color: #7a6452;
  max-width: 220px;
  line-height: 1.6;
}
footer .footer-company {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
footer .footer-company p {
  font-size: 0.8rem;
  color: #a08060;
  max-width: 240px;
}
footer .footer-company a { color: #c2650a; }
footer h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #a08060;
  margin-bottom: 12px;
}
footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
footer ul li a {
  font-size: 0.87rem;
  color: #6b5744;
  transition: color 0.15s;
}
footer ul li a:hover { color: #c2650a; text-decoration: none; }
footer .footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid #e8dcc8;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
footer .footer-bottom p { font-size: 0.82rem; color: #a08060; }
footer .footer-bottom .badges { display: flex; gap: 8px; }
footer .footer-bottom .badges span {
  font-size: 0.75rem;
  background: #fef3e2;
  border: 1px solid #e8c090;
  color: #8a4508;
  padding: 3px 10px;
  border-radius: 20px;
}
/* --- Responsive --- */
@media (max-width: 768px) {

  /* Nav */
  nav .inner { flex-wrap: wrap; gap: 10px; }
  nav ul { flex-wrap: wrap; gap: 4px; }
  nav ul a { padding: 7px 10px; font-size: .82rem; }

  /* Hero */
  .hero { padding: 50px 16px 36px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }

  /* Features */
  .features { grid-template-columns: 1fr; padding: 0 16px 40px; gap: 14px; }

  /* Cards */
  .card { padding: 20px 16px; }

  /* Auth */
  .auth-box { padding: 24px 16px; }
  .auth-wrap { padding: 24px 12px; align-items: flex-start; }

  /* Dashboard */
  .dash-wrap { padding: 24px 16px; }
  .page-title { font-size: 1.3rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 10px; }
  .stat-card .num { font-size: 1.6rem; }

  /* Flows table — make it scrollable */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 560px; font-size: .82rem; }
  th, td { padding: 10px 10px; }

  /* Flow editor */
  .flow-editor { grid-template-columns: 1fr; }
  .connector-list { max-height: 220px; }

  /* Billing */
  .billing-grid { grid-template-columns: 1fr; }
  .request-packages { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pkg { padding: 14px 8px; }

  /* Connectors grid on landing */
  .conn-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
  .conn-badge { padding: 8px 6px; font-size: .72rem; }

  /* Footer */
  footer { padding: 28px 16px 20px; margin-top: 36px; }
  footer .footer-inner { grid-template-columns: 1fr 1fr; gap: 20px; }
  footer .footer-bottom { flex-direction: column; text-align: center; gap: 8px; }
  footer .footer-bottom .badges { justify-content: center; flex-wrap: wrap; }

  /* Buttons full width in auth forms */
  .auth-box .btn { width: 100%; text-align: center; }

  /* Payment buttons */
  #paymentButtons .btn { font-size: .88rem; }

  /* Alert text */
  .alert { font-size: .85rem; }
}

@media (max-width: 420px) {
  nav .logo { font-size: 1.1rem; }
  .hero h1 { font-size: 1.5rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .request-packages { grid-template-columns: 1fr 1fr; }
  footer .footer-inner { grid-template-columns: 1fr; }
  .auth-box { padding: 20px 14px; }
}