
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --graphite: #26352C;
  --graphite-light: #D8EEE0;
  --graphite-soft: #B5DCC5;
  --mint: #C6E8D5;
  --mint-dark: #A8D2BA;
  --white: #26352C;
  --muted: #687B6D;
  --border: #A9CDB6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: #C6E8D5;
  color: var(--graphite);
  font-family: 'DM Sans', sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

.app {
  width: min(100% - 40px, 520px);
  margin: auto;
}

/* HEADER */

.topbar {
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--graphite);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.8px;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--graphite);
  color: var(--mint);
  font-size: 19px;
}

.trademark {
  font-size: 10px;
  vertical-align: top;
}

.status {
  font-size: 9px;
  letter-spacing: 1px;
  color: #3F654B;
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #426B4E;
  border-radius: 50%;
}

/* INTRO */

.intro {
  padding: 48px 0 30px;
}

.eyebrow {
  color: #526E59;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.7px;
  margin-bottom: 13px;
}

.intro h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(32px, 8vw, 43px);
  line-height: 1.08;
  letter-spacing: -2px;
  font-weight: 600;
}

.subheading {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin-top: 15px;
  max-width: 350px;
}

/* CALCULATOR */

.calculator {
  background: #D8EEE0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.calculator-heading {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-bottom: 22px;
}

.version {
  color: #526E59;
}

.display {
  min-height: 115px;
  background: #F0F6EF;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 17px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  overflow: hidden;
}

.display-label {
  width: 100%;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 13px;
}

.expression {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(25px, 7vw, 34px);
  font-weight: 500;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.preview {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
}

/* KEYPAD */

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.key {
  height: 59px;
  border: 1px solid #BDD8C5;
  border-radius: 8px;
  background: #EFF7EF;
  color: var(--graphite);
  font-size: 19px;
  font-weight: 500;
  transition: background 0.15s, transform 0.15s;
}

.key:hover {
  background: #E0EFE3;
}

.key:active {
  transform: scale(0.96);
}

.key.utility {
  color: #3C6147;
  background: #D0E8D7;
  font-size: 15px;
}

.key.operator {
  color: #3C6147;
  font-size: 22px;
}

.key.equals {
  background: var(--graphite);
  color: var(--mint);
  border-color: var(--graphite);
  font-weight: 800;
}

.key.equals:hover {
  background: #3A5141;
}

.calculator-note {
  font-size: 9px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  margin-top: 17px;
}

/* FOOTER */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 24px 0 35px;
  font-size: 8px;
  letter-spacing: 0.6px;
  color: var(--muted);
}

/* MODALS */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(18, 29, 21, 0.78);
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

.modal {
  width: 100%;
  max-width: 410px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: #F7F8F3;
  color: #242A25;
  border-radius: 13px;
  animation: appear 0.25s ease;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-top {
  display: flex;
  justify-content: space-between;
  padding: 18px 21px;
  border-bottom: 1px solid #DDE2DB;
}

.modal-tag {
  font-size: 9px;
  letter-spacing: 1.2px;
  font-weight: 800;
}

.lock-icon {
  font-size: 8px;
  letter-spacing: 0.7px;
  color: #65776B;
  font-weight: 700;
}

.modal-content {
  padding: 25px 22px 22px;
}

.big-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #DDECE1;
  color: #293C30;
  border-radius: 9px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 22px;
}

.mint-icon {
  background: #DDECE1;
}

.modal .eyebrow {
  color: #697F6E;
  font-size: 9px;
}

.modal h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 27px;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 10px;
}

.modal-description {
  color: #737B73;
  font-size: 12px;
  line-height: 1.7;
}

.price-box {
  background: #E8ECE6;
  border: 1px solid #DCE2D9;
  border-radius: 8px;
  padding: 16px;
  margin: 22px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.price-box span {
  color: #748075;
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 700;
}

.price-box strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 30px;
}

.price-box small {
  font-size: 10px;
  color: #7C847C;
}

.primary-btn {
  width: 100%;
  border: none;
  border-radius: 7px;
  background: #263B30;
  color: #C6E8D5;
  padding: 16px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.primary-btn:hover {
  background: #394A3E;
}

.refuse-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: #858B83;
  padding: 17px 8px 10px;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tiny-note {
  text-align: center;
  color: #929990;
  font-size: 9px;
  line-height: 1.7;
  margin-top: 15px;
}

/* REFUSAL MESSAGES */

.refusal-message {
  display: none;
  background: #F0E8DF;
  color: #74543E;
  border-left: 3px solid #B88A62;
  border-radius: 4px;
  padding: 12px;
  font-size: 11px;
  line-height: 1.6;
  margin-top: 14px;
}

.refusal-message.visible {
  display: block;
}

.surrender-btn {
  display: none;
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #27372D;
  background: #DDECE1;
  color: #27372D;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.surrender-btn.visible {
  display: block;
}

/* PAYMENT METHODS */

.method-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: white;
  border: 1px solid #DDE2DB;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
  color: #29332C;
  text-align: left;
}

.method-btn:hover {
  border-color: #7F9B86;
  background: #F7FAF5;
}

.method-icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #E4EEE5;
  color: #344B3A;
  font-size: 19px;
}

.method-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.method-btn strong {
  font-size: 12px;
}

.method-btn small {
  font-size: 10px;
  color: #899087;
}

.method-arrow {
  color: #7D8B7E;
}

/* PROCESSING */

.processing-modal {
  padding: 40px 25px;
  text-align: center;
}

.processing-modal h2 {
  font-size: 21px;
  margin-top: 20px;
}

.processing-modal p {
  font-size: 12px;
  color: #7B837B;
}

.loader {
  width: 35px;
  height: 35px;
  border: 3px solid #DCE7DC;
  border-top-color: #526F59;
  border-radius: 50%;
  margin: auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* SUCCESS */

.success-modal {
  padding: 30px 22px 23px;
  text-align: center;
}

.success-icon {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  background: #DDECE1;
  color: #355440;
  border-radius: 50%;
  font-size: 24px;
  margin: 0 auto 20px;
}

.success-modal .eyebrow {
  color: #66816C;
}

.answer-box {
  background: #E5EEE5;
  border: 1px solid #D5E2D5;
  padding: 20px;
  margin: 23px 0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-box span {
  font-size: 9px;
  letter-spacing: 1px;
  color: #718075;
  font-weight: 700;
}

.answer-box strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 37px;
  color: #293D30;
  overflow-wrap: anywhere;
}

/* MOBILE */

@media (max-width: 380px) {
  .app {
    width: calc(100% - 24px);
  }

  .calculator {
    padding: 13px;
  }

  .keypad {
    gap: 7px;
  }

  .key {
    height: 53px;
  }

  .footer {
    font-size: 7px;
  }
}
