/* Basic reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f4f4f4;
  color: #000000; /* all text defaults to black */
}

/* Make form controls use the same font and color as the page */
button,
input {
  font-family: inherit;
  color: inherit; /* inherit black from body */
}

/* Outer layout: column, shared width for all cards */
.page-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: stretch;
  padding: 2rem;
  max-width: 960px;
  width: 100%;
}

/* Row with the two top cards */
.cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
}

/* Generic card style (big outlined boxes) */
.card {
  background: #ffffff;
  border: 3px solid #000000;
  padding: 2rem 2.5rem;
  /* let flexbox control widths so bottom card and row align */
  flex: 1 1 0;
  min-width: 320px;
}

/* Shared card titles */
.app-title {
  margin-top: 0;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Calculator form layout */
.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Top display box with A & B */
.display-box {
  border: 2px solid #000000;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;  /* A and B labels */
}

.input-row span {
  font-weight: 600;
}

.input-row input {
  flex: 1;
  padding: 0.4rem 0.5rem;
  font-size: 1.2rem;  /* input text */
  border: 2px solid #000000;
  outline: none;
}

/* A+B and A-B buttons row */
.button-row {
  display: flex;
  gap: 1.5rem;
}

.button-row button {
  flex: 1;
  padding: 1.1rem 0;
  font-size: 1.2rem;   /* A+B and A-B */
  font-weight: 600;
  border: 2px solid #000000;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

.button-row button:active {
  transform: translateY(2px);
}

/* Result box (bottom big rectangle) */
.result-box {
  margin: 0;
  border: 2px solid #000000;
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 1.2rem;   /* Result */
  font-weight: 600;
}

/* Info text */
.info-card p {
  line-height: 1.6;
  font-size: 1.05rem;
}

/* Diagram card + image */
.diagram-card {
  width: 100%; /* spans same width as cards row */
}

.diagram-image {
  display: block;
  width: 100%;   /* fills the inside of the card */
  height: auto;
}
