/**
 * Form Page Styles
 * Page-specific styles for form.html
 * Shared docs styles are in docs.css
 */

/* ===========================================================================
   Form Page Layout & Typography Improvements
   ========================================================================== */

/* Improved List Spacing (overrides docs.css defaults) */
ul,
ol {
  margin: 1.5em 0;
}

li {
  margin-bottom: 1.2em;
  line-height: 1.6;
}

/* Nested list spacing */
ul ul,
ul ol,
ol ol,
ol ul {
  margin: 0.5em 0 0.5em 2em;
}

ul ul li,
ul ol li,
ol ol li,
ol ul li {
  margin-bottom: 0.8em;
}

/* Two-column list layout improvements */
.col.four ul li,
.col.four ol li {
  margin-bottom: 0.8em;
  line-height: 1.5;
}

/* Microformat h-card styling */
.vcard {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0 2rem 0;
}

.vcard h6 {
  margin-bottom: 0.8rem;
  color: #2c5f2d;
  font-size: 1.1rem;
}

.vcard p {
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.vcard .adr {
  margin-top: 0.8rem;
}

.vcard .tel {
  margin-top: 0.8rem;
  font-weight: 500;
}

.vcard a {
  color: #1b378c;
  text-decoration: none;
}

.vcard a:hover {
  text-decoration: underline;
}

/* Custom Radio Button & Checkbox Styling */
fieldset.radio ul,
fieldset.check ul {
  list-style: none;
  margin: 0.5rem 0;
  padding: 0;
}

fieldset.radio ul li,
fieldset.check ul li {
  margin-bottom: 0.8rem;
  position: relative;
}

/* Hide default radio/checkbox */
input[type="radio"].custom,
input[type="checkbox"].custom {
  opacity: 0;
  position: absolute;
  left: -9999px;
}

/* Custom radio button styling */
input[type="radio"].custom + span {
  position: relative;
  padding-left: 2rem;
  cursor: pointer;
  display: inline-block;
  line-height: 1.4;
}

input[type="radio"].custom + span:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-radius: 50%;
  background: white;
  transition: all 0.2s ease;
}

input[type="radio"].custom:checked + span:before {
  border-color: #1b378c;
  background: #1b378c;
  box-shadow: inset 0 0 0 3px white;
}

/* Custom checkbox styling */
input[type="checkbox"].custom + span {
  position: relative;
  padding-left: 2rem;
  cursor: pointer;
  display: inline-block;
  line-height: 1.4;
}

input[type="checkbox"].custom + span:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-radius: 3px;
  background: white;
  transition: all 0.2s ease;
}

input[type="checkbox"].custom:checked + span:before {
  border-color: #1b378c;
  background: #1b378c;
}

input[type="checkbox"].custom:checked + span:after {
  content: "\2713";
  position: absolute;
  left: 3px;
  top: 0;
  color: white;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.2;
}

/* Form section spacing improvements */
section {
  margin-bottom: 3rem;
}

section h3 {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  color: #2c5f2d;
  border-bottom: 2px solid #97bc62;
  padding-bottom: 0.5rem;
}

section h4 {
  margin-top: 1.8rem;
  margin-bottom: 1rem;
  color: #495057;
}

section h5,
section h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
}

/* Typography improvements */
.headings h1,
.headings h2,
.headings h3,
.headings h4,
.headings h5,
.headings h6 {
  margin-bottom: 1rem;
  line-height: 1.3;
}

/* Definition list styling */
dl {
  margin: 1.5rem 0;
}

dl dt {
  font-weight: bold;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  color: #2c5f2d;
}

dl dd {
  margin: 0 0 1.2rem 1.5rem;
  line-height: 1.6;
}

/* Blockquote improvements */
blockquote {
  margin: 2rem 0;
  padding: 1rem 2rem;
  background: #f9f9f9;
  border-left: 4px solid #97bc62;
  border-radius: 0 8px 8px 0;
}

blockquote p {
  margin-bottom: 1rem;
  font-style: italic;
  line-height: 1.6;
}

blockquote cite {
  font-style: normal;
  font-size: 0.9rem;
  color: #666;
}

/* Blockquote inside docs header — transparent bg, white text */
.aiab-docs-header blockquote {
  background: transparent;
  border-left-color: rgba(255, 255, 255, 0.5);
}

.aiab-docs-header blockquote p {
  color: white;
}

.aiab-docs-header blockquote cite {
  color: rgba(255, 255, 255, 0.85);
}

/* Code block improvements */
pre {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow-x: auto;
}

/* Vertical rhythm improvements */
p + h3,
p + h4,
p + h5,
p + h6 {
  margin-top: 2rem;
}

.aiab-row + .aiab-row {
  margin-top: 2rem;
}

/* Form styling improvements */
form {
  margin: 1.5rem 0;
}

fieldset {
  margin-bottom: 1.5rem;
  border: none;
  padding: 0;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #e5e5e5;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: #1b378c;
}

button,
.aiab-button {
  background: #1b378c;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

button:hover,
.aiab-button:hover {
  background: #0f2a7a;
  text-decoration: none;
}

/* Address block styling */
aside .vcard {
  background: #fff;
  border: none;
  padding: 0;
  font-style: italic;
  margin: 1rem 0;
}

aside .vcard address {
  font-style: normal;
  line-height: 1.5;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .aiab-col-8,
  .col.nine.last {
    width: 100%;
    margin: 0 0 2rem 0;
  }

  pre {
    padding: 1rem;
    font-size: 0.9rem;
  }

  .vcard {
    padding: 1rem;
  }
}

/* Apple-esque Search Field Styling */
.aiab-search-form {
  position: relative;
  max-width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #f5f5f7;
  border-radius: 10px;
  border: none;
  padding: 0;
  overflow: hidden;
  transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 125, 250, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #86868b;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: #1d1d1f;
  outline: none;
}

.search-input::placeholder {
  color: #86868b;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2386868b'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  cursor: pointer;
  margin-right: 4px;
}
