﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--brand-primary);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* ------------------------------
   Legal Docs Modal (Notebook)
------------------------------ */

/* Modal sizing */
.legal-modal-dialog {
  width: min(920px, 92vw);
  max-width: 920px;
}
.legal-modal-content {
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Paper / Notebook look */
.legal-paper {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
  overflow: hidden;
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Subtle notebook spine */
.legal-paper::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,.06), rgba(0,0,0,.02));
  opacity: .35;
}

/* Header */
.legal-header {
  padding: 18px 20px 12px 26px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.legal-close { margin-top: 4px; opacity: .75; }
.legal-title { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.legal-subtitle { font-size: .9rem; opacity: .7; margin-top: 4px; }

/* Tabs */
.legal-tabs .nav-link {
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
}
.legal-tabs .nav-link.active {
  background: var(--brand-primary);
}

/* Scrollable body */
.legal-body {
  padding: 16px 20px 16px 26px;
  overflow: auto;
  flex: 1;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,.00),
      rgba(0,0,0,.00) 26px,
      rgba(217,2,23,.05) 27px
    ) border-box;
}

/* Table of contents */
.legal-toc {
  background: rgba(0,0,0,.03);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.legal-toc a {
  display: inline-block;
  margin: 4px 10px 4px 0;
  text-decoration: none;
  font-weight: 600;
  opacity: .9;
}
.legal-toc a:hover { text-decoration: underline; }

/* Content typography */
.legal-content {
  font-size: 1rem;
  line-height: 1.75;
}
.legal-content h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,.12);
}
.legal-content p { margin: 10px 0; }
.legal-content ul { margin: 8px 0 12px 20px; }
.legal-content li { margin: 6px 0; }

/* Footer accept bar */
.legal-footer {
  padding: 12px 20px 14px 26px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(0,0,0,.08);
  position: sticky;
  bottom: 0;
  z-index: 3;
}
.legal-agree input { width: 18px; height: 18px; }
.legal-meta { font-size: .85rem; opacity: .7; }

/* Public pages */
.legal-page-content {
  font-size: 1rem;
  line-height: 1.75;
}

/* Mobile tweaks */
@media (max-width: 576px) {
  .legal-paper { border-radius: 14px; }
  .legal-header, .legal-body, .legal-footer { padding-left: 18px; }
  .legal-paper::before { width: 8px; }
}

/* RTL adjustments */
[dir="rtl"] .legal-paper::before {
  left: auto;
  right: 0;
}
[dir="rtl"] .legal-header,
[dir="rtl"] .legal-body,
[dir="rtl"] .legal-footer {
  padding-left: 20px;
  padding-right: 26px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
:root {
  --brand-primary: #d90217;
  --brand-primary-dark: #a60112;
  --brand-primary-hover: #ef233c;
  --brand-text-dark: #111111;
  --brand-text-gray: #5e6d55;
  --brand-bg-light: #f7faf7;
  --brand-neutral-100: #ffffff;
  --wadai-primary: var(--brand-primary);
  --wadai-primary-dark: var(--brand-primary-dark);
  --wadai-surface: var(--brand-bg-light);
}

.auth-section {
  background: var(--wadai-surface);
}

.auth-card {
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-card:hover {
  box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.35);
  transform: translateY(-4px);
}

.auth-hero .auth-icon {
  width: 3rem;
  height: 3rem;
  background: rgba(217, 2, 23, 0.12);
  color: var(--wadai-primary);
  font-size: 1.25rem;
}

.btn-wadai-primary {
  background: linear-gradient(135deg, var(--wadai-primary), var(--wadai-primary-dark));
  color: var(--brand-neutral-100);
  border: none;
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  border-radius: 0.9rem;
}

.btn-wadai-primary:hover,
.btn-wadai-primary:focus {
  background: linear-gradient(135deg, var(--wadai-primary-dark), var(--brand-primary-hover));
  color: var(--brand-neutral-100);
}

.btn-outline-wadai {
  border: 1px solid rgba(217, 2, 23, 0.35);
  color: var(--wadai-primary);
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}

.btn-outline-wadai:hover,
.btn-outline-wadai:focus {
  background: rgba(217, 2, 23, 0.12);
  color: var(--wadai-primary-dark);
  border-color: var(--wadai-primary-dark);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(32, 40, 52, 0.55);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.auth-social {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.auth-provider-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  display: inline-flex;
  justify-content: center;
}

.auth-form .form-label {
  letter-spacing: 0.08em;
}

.auth-form .form-control,
.auth-form .form-select {
  border-radius: 0.9rem;
  border-color: rgba(0, 0, 0, 0.08);
  padding: 0.8rem 1rem;
}

.auth-form .form-control:focus,
.auth-form .form-select:focus {
  border-color: rgba(217, 2, 23, 0.45);
  box-shadow: 0 0 0 0.25rem rgba(217, 2, 23, 0.18);
}

@media (max-width: 991.98px) {
  .auth-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .auth-card {
    border-radius: 1.25rem;
  }
}


/* Language switcher container */
.lang-switch {
    margin-right: 1rem; /* Add spacing between language switcher and search */
}

/* Language pills (fancy circle icons) */
.lang-switch .lang-btn {
    --brand: #d90217;
    --bg: #fff;
    --active-bg: #ffd9d4;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--brand);
    background: var(--bg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    text-decoration: none;
    position: relative;
}

.lang-switch .lang-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.lang-switch .lang-btn:focus {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.lang-switch .lang-btn.active {
    background: var(--active-bg);
}

.lang-switch .lang-btn.active::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--brand);
    opacity: .35;
    pointer-events: none;
}

.lang-switch .lang-flag {
    font-size: 18px;
    line-height: 1;
}

/* Ensure proper RTL support for language switcher */
body.rtl .lang-switch {
    margin-right: 0;
    margin-left: 1rem;
}

/* Optional: shrink on very small screens */
@media (max-width: 420px) {
    .lang-switch .lang-btn {
        width: 38px;
        height: 38px;
    }

    .lang-switch .lang-flag {
        font-size: 16px;
    }
    
    .lang-switch {
        margin-right: 0.5rem;
    }
    
    body.rtl .lang-switch {
        margin-left: 0.5rem;
    }
}

/* Ensure search bar and language switcher don't overlap on medium screens */
@media (max-width: 991.98px) {
    .lang-switch {
        order: -1; /* Move language switcher before search on mobile */
        margin-right: auto;
    }
    
    body.rtl .lang-switch {
        margin-right: 0;
        margin-left: auto;
    }
}