/* VatInfo.org - Financial Trust Aesthetic */
/* Performance-optimized CSS (< 10KB) */

:root {
  --navy-dark: #1a2b49;
  --navy-medium: #2c3e5a;
  --navy-light: #3d5175;
  --emerald: #10b981;
  --emerald-light: #34d399;
  --emerald-dark: #059669;
  --white: #ffffff;
  --gray-light: #f3f4f6;
  --gray-medium: #9ca3af;
  --gray-dark: #4b5563;
  --error: #ef4444;
  --warning: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--navy-dark);
  background: var(--white);
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy-dark);
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.875rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.625rem; }

a {
  color: var(--emerald);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--emerald-dark);
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  background: var(--navy-dark);
  color: var(--white);
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span.highlight {
  color: var(--emerald);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  color: var(--white);
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--emerald-light);
  text-decoration: none;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-medium) 100%);
  color: var(--white);
  padding: 3rem 0;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1rem;
}

.hero .subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* Calculator */
.calculator-wrapper {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  padding: 2rem;
  margin: -2rem auto 3rem;
  max-width: 600px;
  position: relative;
}

.calculator-title {
  text-align: center;
  color: var(--navy-dark);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 500;
  color: var(--navy-dark);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-light);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
  background: var(--white);
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Radio buttons */
.radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.radio-option {
  flex: 1;
  min-width: 120px;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.radio-option label {
  display: block;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-light);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
}

.radio-option input[type="radio"]:checked + label {
  background: var(--emerald);
  color: var(--white);
  border-color: var(--emerald);
}

.radio-option label:hover {
  border-color: var(--emerald-light);
}

/* Current Rate Display */
#currentRate {
  background: var(--gray-light);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--navy-dark);
  margin-top: 0.5rem;
  text-align: center;
  font-weight: 500;
}

/* Buttons */
.btn {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: var(--emerald);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--emerald-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

.btn-block {
  width: 100%;
}

/* Results Section */
.result-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--gray-light);
  display: none;
}

.result-section.show {
  display: block;
  animation: fadeIn 0.3s;
}

.result-section.highlight .result-grid {
  animation: pulse 0.5s;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.result-item {
  background: var(--gray-light);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.result-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--gray-dark);
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy-dark);
}

.result-item.highlight {
  background: var(--emerald);
  color: var(--white);
}

.result-item.highlight .result-label {
  color: rgba(255, 255, 255, 0.8);
}

.result-item.highlight .result-value {
  color: var(--white);
}

/* Error Messages */
.error-message {
  background: var(--error);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
  animation: shake 0.3s;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--navy-dark);
  color: var(--white);
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-light);
}

th {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
}

tbody tr:hover {
  background: var(--gray-light);
}

.rate-cell {
  font-weight: 600;
  color: var(--emerald);
}

/* Content Sections */
.content-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--gray-light);
}

.content-section:last-child {
  border-bottom: none;
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  color: var(--navy-dark);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--gray-dark);
  font-size: 1.125rem;
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card h3 {
  color: var(--navy-dark);
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--gray-dark);
  line-height: 1.6;
}

/* Ad Slots */
.ad-slot {
  background: var(--gray-light);
  border: 2px dashed var(--gray-medium);
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
  border-radius: 8px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-medium);
  font-size: 0.875rem;
}

/* Footer */
footer {
  background: var(--navy-dark);
  color: var(--white);
  padding: 3rem 0 1rem;
  margin-top: 3rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--emerald);
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
}

.footer-section a:hover {
  color: var(--emerald-light);
}

.footer-disclaimer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

.footer-disclaimer strong {
  color: var(--emerald);
  font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  header .container {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    gap: 1rem;
    font-size: 0.875rem;
  }

  .calculator-wrapper {
    padding: 1.5rem;
    margin: -1rem 1rem 2rem;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.75rem;
  }

  th, td {
    padding: 0.5rem;
  }
}

/* Print Styles */
@media print {
  header, footer, nav, .ad-slot {
    display: none;
  }

  .calculator-wrapper {
    box-shadow: none;
    border: 1px solid #000;
  }

  body {
    font-size: 12pt;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
}

/* Hidden by default */
.hidden {
  display: none;
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  border: 3px solid var(--gray-light);
  border-top: 3px solid var(--emerald);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}