/* ============================================
   Wellness Oasis Form Builder - Shared Styles
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400;1,700&family=Open+Sans:wght@400;600;700&display=swap');

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Open Sans', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   Logo Styles
   ============================================ */

.logo-text {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: #1a5c2a;
  line-height: 1.1;
}

.logo-wellness {
  font-weight: 400;
}

.logo-oasis {
  font-weight: 700;
}

/* Library page: larger logo */
.logo-text--large {
  font-size: 42pt;
}

/* Form paper: 30pt logo */
.logo-text--form {
  font-size: 30pt;
}

.tagline {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 11pt;
  color: #555;
  letter-spacing: 0.5px;
}

/* Form header contact info */
.form-header-contact {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 8.5pt;
  color: #444;
  line-height: 1.6;
  text-align: left;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  text-align: center;
  padding: 32px 20px 24px;
  font-size: 11px;
  color: #999;
}

.site-footer a {
  color: #1a5c2a;
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: #1a5c2a;
  color: #fff;
  border: 2px solid #1a5c2a;
}

.btn-primary:hover {
  background: #155223;
  border-color: #155223;
}

.btn-secondary {
  background: transparent;
  color: #1a5c2a;
  border: 2px solid #1a5c2a;
}

.btn-secondary:hover {
  background: #1a5c2a;
  color: #fff;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

/* ============================================
   Card Styles (Form Library)
   ============================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 960px;
}

.form-card {
  position: relative;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 24px 28px;
  text-decoration: none;
  color: #333;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}

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

.form-card__title {
  font-size: 16px;
  font-weight: 700;
  color: #1a5c2a;
  margin-bottom: 6px;
  padding-right: 28px;
}

.form-card__date {
  font-size: 12px;
  color: #888;
}

.form-card__delete {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  color: #bbb;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.form-card__delete:hover {
  background: #fee;
  color: #c00;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state__text {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-state__sub {
  font-size: 13px;
  color: #aaa;
}

/* ============================================
   Form Paper (Editor + Print)
   ============================================ */

.form-paper {
  background: #fff;
  width: 8.5in;
  max-width: 100%;
  min-height: 11in;
  margin: 0 auto;
  padding: 0.75in 1in;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
}

.form-paper__header {
  text-align: left;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #1a5c2a;
}

.form-paper__title {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: #222;
}

/* ============================================
   Field Styles (shared by Editor + Print)
   ============================================ */

.field {
  position: relative;
  padding: 8px 0;
  margin-bottom: 4px;
}

/* Text field */
.field--text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.field--text .field__label {
  font-size: 10pt;
  font-weight: 600;
  white-space: nowrap;
  color: #222;
}

.field--text .field__line {
  flex: 1;
  border-bottom: 1px solid #333;
  min-width: 60px;
  height: 1.4em;
}

.field--text .field__input {
  flex: 1;
  border: none;
  border-bottom: 1px solid #333;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 10pt;
  padding: 2px 4px;
  background: transparent;
  outline: none;
  min-width: 60px;
}

/* Checkbox */
.field--checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field--checkbox .field__box {
  width: 14px;
  height: 14px;
  border: 1.5px solid #333;
  border-radius: 2px;
  flex-shrink: 0;
}

.field--checkbox .field__checkbox {
  width: 16px;
  height: 16px;
  accent-color: #1a5c2a;
  flex-shrink: 0;
  cursor: pointer;
}

.field--checkbox .field__label {
  font-size: 10pt;
  color: #222;
}

/* Checkbox group (e.g., L/R pattern) */
.field--checkbox_group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field--checkbox_group .field__label {
  font-size: 10pt;
  font-weight: 600;
  white-space: nowrap;
  color: #222;
}

.field--checkbox_group .field__options {
  display: flex;
  gap: 12px;
  align-items: center;
}

.field--checkbox_group .field__option {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10pt;
  color: #222;
}

.field--checkbox_group .field__option .field__box {
  width: 14px;
  height: 14px;
  border: 1.5px solid #333;
  border-radius: 2px;
}

.field--checkbox_group .field__option .field__checkbox {
  width: 16px;
  height: 16px;
  accent-color: #1a5c2a;
  cursor: pointer;
}

/* Textarea */
.field--textarea {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field--textarea .field__label {
  font-size: 10pt;
  font-weight: 600;
  color: #222;
}

.field--textarea .field__lined-area {
  min-height: 80px;
  border: 1px solid #ccc;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 23px,
    #ccc 23px,
    #ccc 24px
  );
  background-position: 0 0;
  padding: 4px 6px;
}

.field--textarea .field__textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid #ccc;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 10pt;
  padding: 4px 6px;
  resize: vertical;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 23px,
    #ccc 23px,
    #ccc 24px
  );
  background-position: 0 0;
  outline: none;
}

/* Section Heading */
.field--heading {
  padding: 12px 0 4px;
}

.field--heading .field__label {
  font-size: 12pt;
  font-weight: 700;
  color: #222;
  border-bottom: 2px solid #333;
  padding-bottom: 2px;
  display: inline-block;
}

/* Divider */
.field--divider {
  padding: 8px 0;
}

.field--divider hr {
  border: none;
  border-top: 1px solid #bbb;
}

/* Signature */
.field--signature {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
}

.field--signature .field__label {
  font-size: 10pt;
  font-weight: 600;
  white-space: nowrap;
  color: #222;
}

.field--signature .field__line {
  flex: 1;
  border-bottom: 1px solid #333;
  min-width: 120px;
  height: 1.4em;
}

.field--signature .field__input {
  flex: 1;
  border: none;
  border-bottom: 1px solid #333;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 10pt;
  padding: 2px 4px;
  background: transparent;
  outline: none;
  min-width: 120px;
}

/* ============================================
   Layout Helpers
   ============================================ */

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center {
  text-align: center;
}

/* ============================================
   Top Bar (Editor / Print)
   ============================================ */

.top-bar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar__back {
  font-size: 20px;
  color: #555;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.top-bar__back:hover {
  background: #f0f0f0;
}

.top-bar__title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.top-bar__status {
  font-size: 13px;
  color: #888;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .form-paper {
    padding: 0.5in 0.6in;
    width: 100%;
  }

  .logo-text--large {
    font-size: 32pt;
  }

  .top-bar {
    padding: 10px 16px;
    flex-wrap: wrap;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .no-print,
  .top-bar,
  .site-footer {
    display: none !important;
  }

  body {
    background: #fff;
    padding: 0;
    margin: 0;
  }

  .form-paper {
    box-shadow: none;
    border: none;
    width: 100%;
    max-width: 100%;
    padding: 0.5in 0.75in;
    margin: 0;
    min-height: auto;
  }

  @page {
    size: letter;
    margin: 0.25in;
  }
}
