/* Custom Color Variables */
:root {
  --color-terracotta: #BB7E5D;
  --color-sand: #DBB68F;
  --color-dark-earth: #363020;
  --color-teal: #62929E;
  --color-slate-blue: #7F95D1;
  --color-parchment: #FAF6F0;
  --color-white: #FFFFFF;
  
  --color-paper-bg: #FAF6F0;
  --color-sheet-bg: #FDFBF7;
  --color-border-soft: rgba(219, 182, 143, 0.4);
  --color-border-dark: #363020;
}

/* Base resets and typography */
body {
  background-color: var(--color-paper-bg);
  color: var(--color-dark-earth);
  font-family: 'Lora', 'Georgia', serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  color: var(--color-dark-earth);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

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

/* Header & Navigation */
header {
  border-bottom: 1px solid var(--color-border-soft);
  background-color: var(--color-sheet-bg);
}

.navbar {
  padding: 1rem 0;
}

.navbar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-dark-earth) !important;
  letter-spacing: -0.03em;
}

.navbar-brand span {
  color: var(--color-terracotta);
}

.nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-dark-earth) !important;
  margin-left: 1.5rem;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--color-terracotta) !important;
}

/* Main Container & Layout */
.main-container {
  max-width: 850px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* Paper Sheet Card styling */
.paper-sheet {
  background-color: var(--color-sheet-bg);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(54, 48, 32, 0.04), 0 1px 3px rgba(54, 48, 32, 0.02);
  padding: 3rem;
  margin-bottom: 2rem;
  position: relative;
}

.paper-sheet::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--color-terracotta);
  border-radius: 6px 6px 0 0;
}

/* Custom Buttons */
.btn-stoa-primary {
  background-color: var(--color-terracotta);
  color: #fff !important;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(187, 126, 93, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none !important;
}

.btn-stoa-primary:hover {
  background-color: #a46949;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(187, 126, 93, 0.4);
}

.btn-stoa-secondary {
  background-color: var(--color-teal);
  color: #fff !important;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(98, 146, 158, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none !important;
}

.btn-stoa-secondary:hover {
  background-color: #517c87;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(98, 146, 158, 0.35);
}

.btn-stoa-outline {
  background-color: transparent;
  color: var(--color-dark-earth) !important;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  border: 1px solid var(--color-sand);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none !important;
}

.btn-stoa-outline:hover {
  background-color: var(--color-paper-bg);
  border-color: var(--color-dark-earth);
}

/* Form inputs & inputs custom styles */
.form-group-stoa {
  margin-bottom: 2rem;
}

.form-label-stoa {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-dark-earth);
  display: block;
  margin-bottom: 0.5rem;
}

.form-control-stoa {
  background-color: var(--color-paper-bg);
  border: 1px solid var(--color-sand);
  border-radius: 4px;
  color: var(--color-dark-earth);
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  padding: 0.8rem 1rem;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.form-control-stoa:focus {
  outline: none;
  border-color: var(--color-terracotta);
  background-color: var(--color-sheet-bg);
  box-shadow: 0 0 0 3px rgba(187, 126, 93, 0.15);
}

/* Custom Checklist & Switch List */
.newsletter-list {
  border: 1px solid var(--color-border-soft);
  border-radius: 4px;
  background-color: var(--color-sheet-bg);
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

.newsletter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border-soft);
  transition: background-color 0.2s ease;
}

.newsletter-item:last-child {
  border-bottom: none;
}

.newsletter-item:hover {
  background-color: rgba(219, 182, 143, 0.08);
}

.newsletter-info {
  display: flex;
  flex-direction: column;
}

.newsletter-name {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-dark-earth);
}

.newsletter-email {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: rgba(54, 48, 32, 0.7);
}

/* Custom Paper Checkbox Toggle */
.stoa-checkbox {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.stoa-checkbox input {
  opacity: 0;
  width: 0;
  height: 0;
}

.stoa-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-sand);
  transition: .3s;
  border-radius: 34px;
}

.stoa-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: var(--color-sheet-bg);
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .stoa-slider {
  background-color: var(--color-terracotta);
}

input:focus + .stoa-slider {
  box-shadow: 0 0 1px var(--color-terracotta);
}

input:checked + .stoa-slider:before {
  transform: translateX(24px);
}

/* Landing / Hero styles */
.hero-section {
  text-align: center;
  padding: 3rem 0;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.3rem;
  color: rgba(54, 48, 32, 0.8);
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 4rem;
}

.feature-card {
  background-color: var(--color-sheet-bg);
  border: 1px solid var(--color-border-soft);
  border-radius: 4px;
  padding: 2rem;
  text-align: left;
  transition: transform 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-sand);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--color-terracotta);
}

.feature-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.95rem;
  color: rgba(54, 48, 32, 0.75);
}

/* Notification & Alerts */
.stoa-alert {
  background-color: var(--color-sheet-bg);
  border-left: 4px solid var(--color-slate-blue);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  border-radius: 0 4px 4px 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.stoa-alert-success {
  border-left-color: var(--color-teal);
  background-color: rgba(98, 146, 158, 0.05);
}

.stoa-alert-warning {
  border-left-color: var(--color-terracotta);
  background-color: rgba(187, 126, 93, 0.05);
}

/* Footer style */
footer {
  margin-top: 6rem;
  border-top: 1px solid var(--color-border-soft);
  padding: 2rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  text-align: center;
  color: rgba(54, 48, 32, 0.6);
}

/* Utility Helpers */
.text-serif { font-family: 'Lora', serif; }
.text-sans { font-family: 'Inter', sans-serif; }
.text-accent { color: var(--color-terracotta); }

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .paper-sheet {
    padding: 2rem 1.5rem;
  }
}

/* Tooltip and Popover styling */
.stoa-tooltip-container {
  position: relative;
  display: inline-block;
}

.stoa-tooltip-content {
  visibility: hidden;
  width: 290px;
  background-color: var(--color-sheet-bg);
  color: var(--color-dark-earth);
  text-align: left;
  border: 1px solid var(--color-sand);
  border-radius: 6px;
  padding: 0.85rem;
  position: absolute;
  z-index: 10;
  bottom: 130%; /* Position above the icon */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 15px rgba(54, 48, 32, 0.12);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  line-height: 1.45;
  pointer-events: none; /* Avoid blocking pointer events when hidden */
}

/* Tooltip arrow */
.stoa-tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--color-sand) transparent transparent transparent;
}

/* Bridge to allow mouse to move over to the tooltip */
.stoa-tooltip-container::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 20px;
  display: none;
}

.stoa-tooltip-container:hover::before {
  display: block;
}

.stoa-tooltip-container:hover .stoa-tooltip-content,
.stoa-tooltip-container.active .stoa-tooltip-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
  pointer-events: auto; /* Enable mouse hover/clicks inside the tooltip when visible */
}

.stoa-tooltip-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--color-terracotta);
  font-weight: 600;
  text-decoration: underline;
}

.stoa-tooltip-link:hover {
  color: var(--color-teal);
}

/* On mobile viewports, adjust tooltip position to prevent clipping */
@media (max-width: 576px) {
  .stoa-tooltip-content {
    width: 250px;
    left: auto;
    right: -20px;
    transform: translateX(0);
  }
  
  .stoa-tooltip-content::after {
    left: auto;
    right: 22px;
    margin-left: 0;
  }
  
  .stoa-tooltip-container:hover .stoa-tooltip-content,
  .stoa-tooltip-container.active .stoa-tooltip-content {
    transform: translateX(0) translateY(-4px);
  }
}