/* ── Alan Hesaplayıcı – CSS ────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

.ah-wrapper {
  --ah-bg:        #f7f6f3;
  --ah-surface:   #ffffff;
  --ah-border:    #e4e2dc;
  --ah-text:      #1a1917;
  --ah-muted:     #8a8780;
  --ah-accent:    #2d5a3d;
  --ah-accent-lt: #eef4f0;
  --ah-radius:    14px;
  --ah-shadow:    0 2px 12px rgba(0,0,0,.07);

  font-family: 'DM Sans', sans-serif;
  max-width: 520px;
  margin: 0 auto;
  padding: 36px 28px;
  background: var(--ah-bg);
  border-radius: 20px;
  border: 1px solid var(--ah-border);
  box-sizing: border-box;
}

/* Header */
.ah-header { margin-bottom: 28px; }
.ah-title {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--ah-text);
  margin: 0 0 4px;
  letter-spacing: -.02em;
}
.ah-subtitle {
  font-size: .85rem;
  color: var(--ah-muted);
  margin: 0;
}

/* Tabs */
.ah-shape-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
.ah-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 8px;
  background: var(--ah-surface);
  border: 1.5px solid var(--ah-border);
  border-radius: var(--ah-radius);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  font-weight: 500;
  color: var(--ah-muted);
  transition: all .18s ease;
}
.ah-tab:hover {
  border-color: var(--ah-accent);
  color: var(--ah-accent);
}
.ah-tab.active {
  background: var(--ah-accent);
  border-color: var(--ah-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(45,90,61,.22);
}
.ah-tab-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* Unit Toggle */
.ah-unit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.ah-unit-label {
  font-size: .82rem;
  color: var(--ah-muted);
  font-weight: 500;
}
.ah-unit-toggle {
  display: flex;
  background: var(--ah-surface);
  border: 1.5px solid var(--ah-border);
  border-radius: 8px;
  overflow: hidden;
}
.ah-unit-btn {
  padding: 6px 18px;
  border: none;
  background: transparent;
  font-family: 'DM Mono', monospace;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ah-muted);
  cursor: pointer;
  transition: all .15s ease;
}
.ah-unit-btn.active {
  background: var(--ah-accent);
  color: #fff;
}

/* Forms */
.ah-form { display: none; }
.ah-form.active { display: block; }

.ah-field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.ah-field-group.ah-single {
  grid-template-columns: 1fr;
}
.ah-field { display: flex; flex-direction: column; gap: 6px; }
.ah-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--ah-muted);
}
.ah-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--ah-border);
  border-radius: var(--ah-radius);
  background: var(--ah-surface);
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  color: var(--ah-text);
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
  -moz-appearance: textfield;
}
.ah-input::-webkit-outer-spin-button,
.ah-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ah-input:focus {
  border-color: var(--ah-accent);
  box-shadow: 0 0 0 3px rgba(45,90,61,.1);
}

.ah-formula {
  font-family: 'DM Mono', monospace;
  font-size: .78rem;
  color: var(--ah-muted);
  background: var(--ah-accent-lt);
  border: 1px solid #c8ddd0;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 22px;
}

/* Button */
.ah-btn {
  width: 100%;
  padding: 14px;
  background: var(--ah-accent);
  color: #fff;
  border: none;
  border-radius: var(--ah-radius);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px rgba(45,90,61,.25);
  letter-spacing: -.01em;
}
.ah-btn:hover {
  background: #245033;
  box-shadow: 0 6px 20px rgba(45,90,61,.32);
}
.ah-btn:active { transform: scale(.98); }
.ah-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}

/* Spinner animation */
.ah-btn-spinner svg {
  animation: ah-spin .7s linear infinite;
}
@keyframes ah-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Result */
.ah-result {
  margin-top: 22px;
  padding: 22px;
  background: var(--ah-surface);
  border: 1.5px solid var(--ah-border);
  border-radius: var(--ah-radius);
  text-align: center;
  animation: ah-fadeup .3s ease;
}
@keyframes ah-fadeup {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ah-result-label {
  font-size: .78rem;
  color: var(--ah-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.ah-result-value {
  font-family: 'DM Mono', monospace;
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--ah-accent);
  line-height: 1;
}
.ah-result-unit {
  font-size: .82rem;
  color: var(--ah-muted);
  margin-top: 4px;
}

/* Error */
.ah-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef3f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: .82rem;
  text-align: center;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .ah-wrapper { padding: 24px 18px; }
  .ah-tab { font-size: .75rem; padding: 10px 6px; }
  .ah-tab-icon { font-size: 1.1rem; }
  .ah-result-value { font-size: 1.8rem; }
}
