/* static/style.css */

/* --- Global --- */
:root {
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --primary: #004d9c;
  --accent: #0091ea;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e0e6ed;
  --success: #2e7d32;
  --danger: #c62828;
  --font: "Inter", "Segoe UI", Roboto, sans-serif;
}

html, body {
  background-color: var(--bg);
  font-family: var(--font);
  color: var(--text);
  margin: 0;
  padding: 0;
}

/* --- Basic Elements --- */
h1, h2, h3, h4 {
  color: var(--primary);
  margin-top: 0;
}

h1 {
  text-align: center;
  margin: 1rem 0;
  font-size: 1.8rem;
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* --- Header + Nav --- */
.topbar {
  background: var(--primary);
  color: #fff;
  padding: 0.6rem 0;
}

.topbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.brand {
  font-weight: 600;
  font-size: 1.1rem;
}

.menu a {
  color: #fff;
  text-decoration: none;
  margin-left: 1rem;
  font-weight: 500;
}

.menu a.active {
  border-bottom: 2px solid #fff;
}

/* --- Layout --- */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
  padding: 1rem 1.3rem;
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.card h3 {
  margin-top: 0;
  color: var(--primary);
}

/* --- Forms --- */
label {
  display: block;
  margin: 0.3rem 0;
  font-weight: 500;
}

.row {
  margin-bottom: 0.4rem;
}

input[type="number"],
input[type="text"] {
  width: 100px;
  padding: 0.3rem 0.4rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

input[type="checkbox"] {
  margin-right: 0.3rem;
  transform: scale(1.1);
}

/* ✅ Added missing .hide/.show */
.hide { display: none !important; }
.show { display: block !important; }

/* --- Tables --- */
.kv {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.kv th, .kv td {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
  font-size: 0.9rem;
}

.kv th {
  color: var(--muted);
  font-weight: 600;
  width: 45%;
  vertical-align: top;
}

.kv td {
  color: var(--text);
}

.kv thead th {
  background-color: var(--accent);
  color: #fff;
  text-align: center;
}

.kv tbody tr:last-child td {
  border-bottom: none;
}

/* --- Subcards --- */
.subcards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.7rem;
}

.sub {
  flex: 1 1 48%;
  background: #fafbff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
}

.subtitle {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* --- Totals --- */
.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1.2rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.totals .pill {
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  text-align: center;
}

.totals .big {
  font-size: 1.6rem;
  text-align: center;
  font-weight: 700;
  color: var(--primary);
}

/* --- Notes and hints --- */
.hint {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.3rem 0;
  text-align: left;
}

.kpi {
  margin-top: 0.5rem;
}

.kpi .k {
  background: #f0f6ff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
}

.kpi .k h4 {
  color: var(--primary);
  margin: 0 0 0.3rem;
}

/* --- Buttons --- */
button, .btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s ease;
}

button:hover, .btn:hover {
  background: var(--primary);
}

/* --- Responsive tweaks --- */
@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .totals {
    grid-template-columns: 1fr;
  }
}

/* === Checkbox label alignment fix === */
input[type="checkbox"] {
  vertical-align: middle;
  margin-right: 6px;
}

label {
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
}

.rows .row {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* === Assumptions Page Styling Improvements === */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.5rem;
}

/* Grid layout for top-level sections */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

/* Label & Input alignment */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.row label {
  flex: 1;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

.row input[type="number"] {
  width: 90px;
  padding: 0.3rem 0.4rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: right;
}

/* Subpanel styling for SUPPORT sections */
.subpanel {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.6rem;
}

.subpanel .subtitle {
  font-weight: 600;
  color: #1e40af;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

/* Section headers */
.card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.3rem;
  margin-bottom: 0.8rem;
}

/* Save button section */
#save_btn {
  background: #2563eb;
  color: white;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

#save_btn:hover {
  background: #1d4ed8;
}

#save_status {
  margin-left: 1rem;
  color: #2563eb;
  font-weight: 500;
}

.span-12 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
}

.azure-card {
  padding: 8px 10px;
  background: var(--card-bg-alt, #f8f8f8);
  border-radius: 8px;
  border: 1px solid #ddd;
  line-height: 1.4;
}
.azure-card p {
  margin: 4px 0;
}
.azure-card a {
  color: #0078d7;
  text-decoration: none;
}
.azure-card a:hover {
  text-decoration: underline;
}

/* --- Azure VM Card Styling --- */
.azure-section {
  margin-top: 0.8rem;
}

.azure-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
  padding: 1.3rem 1.5rem;
  transition: all 0.2s ease;
}

.azure-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.08);
}

/* --- Azure VM Header and Badge Alignment --- */
.vm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  position: relative;
}

.vm-header h4 {
  margin: 0;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 600;
}

.vm-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.vm-badge {
  background: var(--accent);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.8rem;
  flex-shrink: 0;
  white-space: nowrap;
}


.vm-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.4rem 1rem;
  margin-top: 1rem;
  background: #f4f7fc;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
}

.vm-pricing div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vm-pricing span {
  color: var(--muted);
}

.vm-pricing strong {
  color: var(--primary);
}

.vm-tags {
  margin-top: 0.8rem;
}

.vm-tags .tag {
  display: inline-block;
  background: #eef5ff;
  color: #004d9c;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  margin-right: 0.4rem;
  font-size: 0.85rem;
}

.vm-usecases {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
}

/* --- Azure Pricing Card --- */
.monthly-price {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.8rem;
}

.monthly-price div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f4f7fc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
}

.monthly-price span {
  color: var(--muted);
}

.monthly-price strong {
  color: var(--primary);
  font-size: 1rem;
}
