/* ------------------------------
   Variables couleurs
------------------------------ */
:root {
  --primary-400: hsl(172, 67%, 45%);

  --green-900: hsl(183, 100%, 15%);
  --grey-500: hsl(186, 14%, 43%);
  --grey-400: hsl(184, 14%, 56%);
  --grey-200: hsl(185, 41%, 84%);
  --grey-50: hsl(189, 47%, 97%);
  --white: hsl(0, 100%, 100%);
}

/* ------------------------------
   Reset de base
------------------------------ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Mono", monospace;
  background: var(--grey-200);
  color: var(--green-900);
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
main .logo {
  display: block;
  margin: 0 auto 2rem;
}
section {
  background: var(--white);
  border-radius: 1.25rem;
  margin-top: 3rem;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* ------------------------------
   Panel gauche
------------------------------ */
.left-panel h1 {
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--grey-500);
  margin: 1rem 0 0.5rem;
}

.bill,
.people {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--grey-50);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}
.bill:focus-within,
.bill input:not(:placeholder-shown),
.people:focus-within,
.people input:not(:placeholder-shown) {
  border-color: hsl(172, 67%, 45%);
}

.bill input,
.people input {
  width: 100%;
  border: none;
  background: transparent;
  text-align: right;
  font: 700 1.2rem "Space Mono", monospace;
  color: var(--green-900);
  outline: none;
}

.tip-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.tip-button {
  background: var(--green-900);
  color: var(--grey-50);
  border: none;
  border-radius: 0.45rem;
  font: 700 1.1rem/1 "Space Mono", monospace;
  padding: 0.9rem 0.5rem;
  cursor: pointer;
}
.tip-button.active {
  background: var(--primary-400);
  color: var(--green-900);
}
.custom-tip-input {
  background: var(--grey-50);
  border: none;
  border-radius: 0.45rem;
  padding: 0.9rem 0.75rem;
  text-align: right;
  font: 700 1.1rem/1 "Space Mono", monospace;
  outline: none;
  color: var(--green-900);
}
.custom-tip-input::placeholder {
  color: var(--grey-400);
}

/* ------------------------------
   Panel droit
------------------------------ */
.right-panel {
  background: var(--green-900);
  color: var(--white);
  border-radius: 1rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.title-tip,
.title-total {
  margin: 0;
}

.amount-person,
.totals-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tip-amount,
.total-amount {
  flex: 1;
  border: none;
  background: transparent;
  text-align: right;
  font: 700 2rem "Space Mono", monospace;
  color: var(--primary-400);
  outline: none;
}

.reset {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--primary-400);
  color: var(--green-900);
  font: 700 1rem "Space Mono", monospace;
  text-transform: uppercase;
  cursor: pointer;
}

.reset:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ------------------------------
   Responsive
------------------------------ */
@media (max-width: 820px) {
  section {
    grid-template-columns: 1fr;
  }
}
