/* -------------------------------------------------------------
   style.css
   Layout clean e minimalista para a calculadora.
   Paleta neutra, fonte simples, totalmente responsivo.
------------------------------------------------------------- */

:root {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-text: #1f2429;
  --color-muted: #8a8f98;
  --color-border: #e3e5e8;
  --color-key: #f0f1f3;
  --color-key-hover: #e6e8eb;
  --color-operator: #eef1ff;
  --color-operator-text: #3452e1;
  --color-equals: #1f2429;
  --color-equals-text: #ffffff;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  padding: 24px;
}

.calculator-app {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calculator-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
}

.calculator {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(20, 20, 30, 0.06);
}

.calculator-display {
  background: var(--color-bg);
  border-radius: 10px;
  padding: 22px 16px;
  margin-bottom: 16px;
  text-align: right;
  font-size: 2.2rem;
  font-weight: 300;
  min-height: 64px;
  overflow-x: auto;
  white-space: nowrap;
  word-break: break-all;
}

.calculator-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.key {
  border: none;
  outline: none;
  background: var(--color-key);
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 16px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.key:hover {
  background: var(--color-key-hover);
}

.key:active {
  transform: scale(0.96);
}

.key-operator {
  background: var(--color-operator);
  color: var(--color-operator-text);
}

.key-function {
  color: var(--color-muted);
}

.key-equals {
  background: var(--color-equals);
  color: var(--color-equals-text);
  grid-row: span 1;
}

.key-zero {
  grid-column: span 1;
}

.calculator-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* ---------------- Responsivo ---------------- */
@media (max-width: 400px) {
  .calculator-display {
    font-size: 1.8rem;
  }

  .key {
    padding: 14px 0;
    font-size: 1rem;
  }
}
