/* src/css/main.css */

/* === Global Variables === */
:root {
  --bg1: #00ab9a;     /* Light teal background */
  --bg2: #00786c;     /* Dark teal gradient base */
  --accent: #00453e;  /* Main accent color */
  --ink: #fff;        /* White text */
  --faq: #227976;     /* FAQ highlight */
}

/* === Base / Fonts === */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  color: var(--ink);
  font-size: 19px;
}

html[dir="rtl"] body {
  font-family: "Zain", sans-serif;
  line-height: 1.9;
}

/* === Card Component === */
.card {
  background: var(--accent);
  border: 1.2px solid var(--accent);
  color: var(--ink);
}

/* === Button Component === */
.btn {
  background: rgba(255, 255, 255, .08);
  border: 1.6px solid var(--accent);
}
.btn:hover { background: rgba(255, 255, 255, .15); }

/* Disabled state */
.disabled {
  opacity: .55;
  pointer-events: none;
  filter: grayscale(.3);
}

/* === Badge === */
.badge {
  font-size: .75em;
  padding: .15em .55em;
  border: 1px solid #ffffff40;
  border-radius: .6rem;
}

/* === FAQ Launcher & Panel === */
.rehaf-faq-launcher, .rehaf-faq-panel {
  position: fixed;
  right: 18px;
  z-index: 2147483647;
}

.rehaf-faq-launcher {
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.rehaf-faq-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}

.rehaf-faq-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rehaf-faq-avatar:hover {
  box-shadow: 0 14px 38px rgba(0,0,0,.32);
  transform: scale(1.1);
  transition: transform .2s ease, box-shadow .2s ease;
}

.rehaf-faq-label {
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.rehaf-faq-panel {
  bottom: 84px;
  width: 360px;
  max-height: 72vh;
  display: none;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0,0,0,.28);
  border: 1px solid #e9ecef;
}

.rehaf-faq-header {
  background: var(--accent);
  color: #fff;
  padding: 10px 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1;
}

.rehaf-faq-body {
  padding: 10px;
  font-size: 14px;
  color: #0f2d29;
  overflow: auto;
  flex: 1;
}

.rehaf-faq-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

/* FAQ Q items */
.q-item {
  border: 1px solid var(--faq);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 8px 0;
  background: #f8fffd;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-item:hover { background: #f2fbf8; }

.q-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--faq);
  opacity: .85;
}

.answer {
  border: 1px solid var(--faq);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fffd;
  white-space: pre-wrap;
  line-height: 1.35;
}

.faq-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.faq-actions button {
  border: 1px solid var(--faq);
  background: #fff;
  color: #0f2d29;
  padding: 7px 10px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.faq-actions button:hover { background: #f2fbf8; }

/* =========================================================
   REHAF Lead Modal (works with app.js builder)
   ========================================================= */

.rehaf-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2147483646; /* below FAQ bubble */
}

.rehaf-modal.is-open{ display:block; }

.rehaf-modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}

.rehaf-modal__panel{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 24px));
  max-height: min(84vh, 760px);
  background:#fff;
  border-radius: 18px;
  overflow:hidden;
  box-shadow: 0 18px 44px rgba(0,0,0,.28);
  border: 1px solid rgba(0,0,0,.10);
  display:flex;
  flex-direction:column;
  font-family: inherit;
}

.rehaf-modal__header{
  background: var(--accent);
  color:#fff;
  padding: 12px 12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
}

.rehaf-modal__brand{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  min-width: 0;
}

/* Logo in popup: no background, slightly bigger */
.rehaf-modal__avatar{
  width: 56px;
  height: 56px;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  border: none;
  flex: 0 0 auto;
  display:grid;
  place-items:center;
}

.rehaf-modal__avatar img{
  width: 100%;
  height: auto;
  object-fit: contain;
}

.rehaf-modal__headings{ min-width:0; }

.rehaf-modal__title{
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.rehaf-modal__subtitle{
  margin-top: 4px;
  font-size: 13.5px;
  opacity: .92;
  line-height: 1.35;
}

.rehaf-modal__close{
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 12px;
}

.rehaf-modal__close:hover{ background: rgba(255,255,255,.12); }

.rehaf-modal__body{
  padding: 14px;
  overflow:auto;
  color: #0f2d29;
  font-size: 18px;
}

/* Form layout */
.rehaf-form{ margin:0; }

.rehaf-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rehaf-field--full{ grid-column: 1 / -1; }

.rehaf-label{
  display:block;
  font-weight: 700;
  font-size: 15.5px;
  color:#0f2d29;
  margin-bottom: 6px;
}

.rehaf-input, .rehaf-textarea{
  width:100%;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
}

.rehaf-textarea{ resize: vertical; min-height: 110px; }
/* ===========================
   File input styling (CV PDF)
   =========================== */

.rehaf-input[type="file"]{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  font-size: 14.5px;
  color: #0f2d29;
  cursor: pointer;
}

/* The actual “Choose file” button */
.rehaf-input[type="file"]::file-selector-button{
  margin-right: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.rehaf-input[type="file"]::file-selector-button:hover{
  filter: brightness(1.06);
}

/* RTL spacing fix */
html[dir="rtl"] .rehaf-input[type="file"]::file-selector-button{
  margin-right: 0;
  margin-left: 10px;
}
.rehaf-input:focus, .rehaf-textarea:focus{
  border-color: rgba(0,69,62,.55);
  box-shadow: 0 0 0 4px rgba(0,69,62,.12);
}

.rehaf-error{
  margin-top: 6px;
  font-size: 12.5px;
  color: rgba(160,20,20,.92);
  min-height: 16px;
}

.rehaf-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Buttons inside modal */
.rehaf-btn{
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,.10);
  font-size: 14px;
}

.rehaf-btn--primary{
  background: var(--accent);
  color: #fff;
  border-color: rgba(0,0,0,.12);
}

.rehaf-btn--primary:hover{ filter: brightness(1.06); }

.rehaf-btn--ghost{
  background: #fff;
  color: #0f2d29;
  border: 1px solid rgba(0,0,0,.14);
}

.rehaf-btn--ghost:hover{ background: rgba(0,0,0,.03); }

.rehaf-status{
  font-size: 13px;
  opacity: .9;
}

/* Honeypot hidden */
.rehaf-hp{
  position:absolute;
  left:-9999px;
  width:1px;
  height:1px;
  opacity:0;
}

/* Success state */
.rehaf-success{ padding: 10px 2px 2px; }

.rehaf-success__title{
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 6px;
  color:#0f2d29;
}

.rehaf-success__text{
  font-size: 14.5px;
  color:#355a53;
  margin-bottom: 12px;
}

/* Mobile: bottom-sheet feel */
@media (max-width: 720px){
  .rehaf-modal__panel{
    left: 50%;
    top: auto;
    bottom: 12px;
    transform: translate(-50%, 0);
    width: calc(100vw - 24px);
    max-height: 86vh;
  }
  .rehaf-grid{ grid-template-columns: 1fr; }
}

/* RTL support */
[dir="rtl"] .rehaf-modal__brand{ flex-direction: row-reverse; }
[dir="rtl"] .rehaf-modal__headings{ text-align: right; }
[dir="rtl"] .rehaf-modal__body{ text-align: right; }
[dir="rtl"] .rehaf-actions{ justify-content: flex-start; }