/* 1. Brand color variables */
:root {
  --color-primary:   #003A63;   /* Midnight Blue */
  --color-secondary: #2E2E2E;   /* Soft Charcoal */
  --color-accent:    #FFC857;   /* Warm Amber */
  --color-bg:        #FFFFFF;   /* Pure White */
  --color-muted:     #A8BBC6;   /* Cool Slate */
  --color-alt-bg:    #F9F9F9;   /* Page background */
}

/* 2. Global typography: apply Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

body,
button,
input,
label,
p,
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, Oxygen, Ubuntu,
               Cantarell, 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
}

/* 3. Base body styles */
body {
  background-color: var(--color-alt-bg);
  color: var(--color-secondary);
  line-height: 1.5;
}

/* Header */
.site-header,
header {
  text-align: center;
  padding: 1rem;
}

/* 4. Tabs */
.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.tabs button {
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  background: none;
  color: var(--color-secondary);
  font-weight: 600;
}
.tabs button.active {
  background-color: var(--color-accent);
  color: var(--color-secondary);
}

/* 5. Main layout */
main {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}
@media (max-width: 600px) {
  main { padding: 0.5rem; }
}

/* 6. Forms */
form {
  display: flex;
  flex-direction: column;
}
label {
  margin-bottom: 0.5rem;
  font-weight: 600;
}
input {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--color-muted);
  border-radius: 4px;
}
@media (max-width: 600px) {
  input { font-size: 1.2rem; }
}

/* 7. Buttons */
button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background-color: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
button:hover {
  background-color: var(--color-secondary);
}
@media (max-width: 600px) {
  button { font-size: 1.2rem; }
}

/* 8. Inline SVG icon styling */
button .icon {
  width: 1em;
  height: 1em;
  margin-right: 0.5em;
  vertical-align: middle;
  fill: currentColor;
}

/* 9. Code display styling */
#codeDisplay {
  font-weight: 800;             /* Extra-bold */
  font-size: 2rem;              /* Larger size */
  color: var(--color-accent);   /* Amber to stand out */
  display: inline-block;
  margin-left: 0.25rem;
}
#phoneticDisplay {
  font-weight: 600;             /* Semi-bold */
  color: var(--color-accent);
}

/* 10. Highlight retrieved email */
#emailDisplay {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 0.5rem;
}

/* 11. Error styling */
.error {
  color: #D14343;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

/* 12. Ad placeholder */
.ad-placeholder {
  text-align: center;
  padding: 1rem;
  background: var(--color-muted);
  margin-top: 2rem;
  border-radius: 4px;
}

/* 13. Flex row for Copy + Send Email */
.button-row {
  display: flex;
  align-items: center;
  width: 100%;
}
/* Reserve space for Copy + “Copied!” */
.copy-container {
  display: inline-flex;
  align-items: center;
  min-width: 10ch;
}
/* Pin Send Email to right */
.button-row > #mailtoBtn {
  margin-left: auto;
}

/* 14. Logo resizing */
.logo {
  height: auto;
  max-width: 100%;
  max-height: 60px;
  padding: 10px 0;
}
@media (max-width: 480px) {
  .logo { max-height: 50px; }
}

/* 15. Utility class */
.hidden {
  display: none !important;
}

/* 16. Hide result & retrieve sections until JS toggles them */
#codeResult,
#retrieveSection {
  display: none !important;
}
#codeResult:not(.hidden),
#retrieveSection:not(.hidden) {
  display: block !important;
}

/* 17. “Copied!” message – hidden by default, shown only when JS removes .hidden */
#copyMessage {
  display: none;
  opacity: 0;
  font-size: 0.9rem;
  color: var(--color-accent);
  margin-left: 0.5rem;
  transition: opacity 0.2s ease;
}
#copyMessage:not(.hidden) {
  display: inline-block;
  opacity: 1;
}

/* 18. Responsive adjustments */
@media (max-width: 600px) {
  .tabs { flex-direction: column; }
  input, button { font-size: 1.2rem; }
}
