/* ============================================
   MAF Loans LLC — Shared Styles
   Header, Footer, Forms, Page Layouts (Responsive)
   ============================================ */

/* --- Shared Header --- */
.maf-header {
  background: var(--color-bg, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.maf-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.maf-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text, #000);
  text-decoration: none;
  line-height: 1.2;
}

.maf-header__logo:hover {
  color: var(--color-accent, #5376FF);
}

.maf-header__logo img,
.maf-footer__logo img {
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.maf-header__logo .maf-site-logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text, #000);
}

.maf-header__logo:hover .maf-site-logo-text {
  color: var(--color-accent, #5376FF);
}

.maf-header__nav {
  display: none;
}

@media (min-width: 768px) {
  .maf-header__nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
  }
}

.maf-header__nav-link {
  color: var(--color-text-secondary, #666);
  text-decoration: none;
  font-size: 0.9rem;
}

.maf-header__nav-link:hover {
  color: var(--color-accent, #5376FF);
}

.maf-header__nav-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.maf-header__nav-group + .maf-header__nav-group {
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(0,0,0,0.1);
}

.maf-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-accent, #5376FF);
  color: #fff !important;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}

.maf-header__cta:hover {
  background: var(--color-accent-hover, #4563e6);
}

.maf-header__burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

@media (min-width: 768px) {
  .maf-header__burger {
    display: none;
  }
}

.maf-header__burger span {
  width: 24px;
  height: 2px;
  background: var(--color-text, #000);
}

.maf-header__mobile-nav {
  display: none;
  flex-direction: column;
  padding: 1rem 1.5rem;
  background: var(--color-bg-blocks, #f5f5f5);
  border-top: 1px solid rgba(0,0,0,0.06);
}

.maf-header__mobile-nav.is-open {
  display: flex;
}

.maf-header__mobile-nav .maf-header__nav-link {
  padding: 0.5rem 0;
}

/* --- Shared Footer --- */
.maf-footer {
  background: #1a1a2e;
  color: #e0e0e0;
  margin-top: auto;
}

.maf-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
}

.maf-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .maf-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .maf-footer__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.maf-footer__section-title {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem;
}

.maf-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.maf-footer__links li {
  margin-bottom: 0.5rem;
}

.maf-footer__links a {
  color: #b0b0b0;
  text-decoration: none;
  font-size: 0.9rem;
}

.maf-footer__links a:hover {
  color: #fff;
}

.maf-footer__logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.maf-footer__logo .maf-site-logo-text {
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
}

.maf-footer__logo:hover {
  opacity: 0.92;
}

.maf-footer__logo:hover img {
  filter: brightness(1.08);
}

.maf-footer__logo:hover .maf-site-logo-text {
  color: var(--color-accent, #5376FF);
}

.maf-footer__disclaimer {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.maf-footer__disclaimer p {
  margin: 0;
  color: inherit;
}

.maf-footer__disclaimer strong {
  color: #fff;
}

.maf-footer__badge-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.maf-footer__ssl-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #8bc34a;
}

.maf-footer__ssl-badge svg {
  flex-shrink: 0;
}

.maf-footer__copyright {
  font-size: 0.8rem;
  color: #777;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* --- Page Layouts --- */
.maf-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.maf-page__main {
  flex: 1;
  padding: 2rem 1.5rem;
}

.maf-container {
  max-width: 1200px;
  margin: 0 auto;
}

.maf-container--narrow {
  max-width: 720px;
}

.maf-container--centered {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.maf-page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.maf-page-subtitle {
  color: var(--color-text-secondary, #666);
  margin: 0 0 2rem;
  font-size: 1rem;
}

/* --- Form Styles --- */
.maf-form-group {
  margin-bottom: 1.25rem;
}

.maf-form-label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--color-text, #000);
}

.maf-form-label--required::after {
  content: ' *';
  color: #c00;
}

.maf-form-input,
.maf-form-textarea,
.maf-form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.maf-form-input:focus,
.maf-form-textarea:focus,
.maf-form-select:focus {
  outline: none;
  border-color: var(--color-accent, #5376FF);
  box-shadow: 0 0 0 3px rgba(83, 118, 255, 0.2);
}

.maf-form-input.error,
.maf-form-textarea.error {
  border-color: #c00;
}

.maf-form-textarea {
  min-height: 120px;
  resize: vertical;
}

.maf-form-error {
  font-size: 0.8rem;
  color: #c00;
  margin-top: 0.3rem;
}

.maf-form-success {
  font-size: 0.9rem;
  color: #2e7d32;
  margin-top: 0.5rem;
}

/* --- Contact Cards --- */
.maf-contact-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.maf-contact-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #fff;
  border: 1px solid #e8e8ec;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.maf-contact-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: rgba(83, 118, 255, 0.2);
}

.maf-contact-card__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(83, 118, 255, 0.1);
  border-radius: 12px;
  color: var(--color-accent, #5376FF);
}

.maf-contact-card__icon svg {
  width: 24px;
  height: 24px;
}

.maf-contact-card__body {
  flex: 1;
  min-width: 0;
}

.maf-contact-card__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary, #666);
  margin: 0 0 0.25rem;
}

.maf-contact-card__value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text, #000);
  text-decoration: none;
  display: block;
  word-break: break-word;
}

.maf-contact-card__value[href]:hover {
  color: var(--color-accent, #5376FF);
}

.maf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.maf-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.maf-btn--primary {
  background: var(--color-accent, #5376FF);
  color: #fff;
}

.maf-btn--primary:hover:not(:disabled) {
  background: var(--color-accent-hover, #4563e6);
}

.maf-btn--full {
  width: 100%;
}

.maf-btn--lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

/* --- Cards --- */
.maf-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.maf-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.maf-card__text {
  font-size: 0.95rem;
  color: var(--color-text-secondary, #666);
  margin: 0;
  line-height: 1.6;
}

/* --- Tables --- */
.maf-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.maf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.maf-table th,
.maf-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.maf-table th {
  font-weight: 600;
  background: #f8f8f8;
  color: var(--color-text, #000);
}

.maf-table tr:hover td {
  background: #fafafa;
}

/* --- Legal / Content Pages --- */
.maf-legal-content {
  font-size: 0.95rem;
  line-height: 1.7;
}

.maf-legal-content h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.maf-legal-content h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.maf-legal-content h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.maf-legal-content p {
  margin: 0 0 1rem;
  color: var(--color-text-secondary, #555);
}

.maf-legal-content ul, .maf-legal-content ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.maf-legal-content li {
  margin-bottom: 0.4rem;
}

.maf-legal-content .maf-last-updated {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1.5rem;
}

/* --- Success / Confirmation Pages --- */
.maf-success-box {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 12px;
  margin: 2rem 0;
}

.maf-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.maf-success-icon svg {
  width: 36px;
  height: 36px;
}

.maf-success-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #166534;
}

.maf-success-text {
  color: #15803d;
  margin: 0 0 1.5rem;
}

/* --- Apply Page (centered) --- */
.maf-apply-wrapper {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 0;
}

.maf-apply-wrapper iframe,
.maf-apply-wrapper .maf-form-embed {
  width: 100%;
  min-height: 600px;
  border: none;
}

/* --- Responsive --- */
@media (max-width: 767px) {
  .maf-page__main {
    padding: 1.5rem 1rem;
  }

  .maf-page-title {
    font-size: 1.5rem;
  }

  .maf-footer__inner {
    padding: 1.5rem 1rem;
  }
}
