﻿:root {
      --bg-color: #f0f4f8;
      --form-bg: #ffffffcc;
      --text-color: #1b5e20;
      --icon-color: #66bb6a;
      --input-border: #c8e6c9;
      --button-bg: #2e7d32;
      --button-hover: #388e3c;
      --switch-bg: rgba(255, 255, 255, 0.3);
      --glow-color: rgba(100, 255, 100, 0.5);
      --asterisk-color: red;
    }
    body.dark {
      --bg-color: #121212;
      --form-bg: #1e1e1e;
      --text-color: #c8e6c9;
      --icon-color: #a5d6a7;
      --input-border: #4caf50;
  --field-bg: #1e1e1e;
      --button-bg: #43a047;
      --button-hover: #66bb6a;
      --switch-bg: rgba(50, 50, 50, 0.3);
      --glow-color: rgba(0, 255, 100, 0.3);
      --asterisk-color: #ff8888;
    }
    * { box-sizing: border-box; }
    body {
      font-family: 'Roboto', sans-serif;
      margin: 0; padding: 0;
      background-color: var(--bg-color);
      color: var(--text-color);
      display: flex; flex-direction: column; align-items: center;
      min-height: 100vh;
    }
    .switchers {
      position: absolute; top: 12px; right: 12px;
      background: var(--switch-bg);
      padding: 10px;
      border-radius: 40px;
      display: flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      backdrop-filter: blur(8px);
      z-index: 9999;
      direction: ltr;
    }
    .switchers button {
      background: transparent; border: none; color: var(--text-color);
      cursor: pointer; font-weight: bold; padding: 8px 12px;
      border-radius: 20px;
      transition: background 0.3s, box-shadow 0.3s;
      font-size: 0.9em;
    }
    .switchers button.active {
      background: var(--button-bg); color: #fff;
    }
    .switchers button#toggleMode {
      font-size: 1.2em;
      padding: 8px;
      border-radius: 50%;
    }
    body.dark .switchers button#toggleMode {
      box-shadow: 0 0 10px var(--glow-color);
      color: #00ff88;
    }
    .container {
      background: var(--form-bg);
      padding: 30px;
      margin-top: 80px;
      border-radius: 16px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.1);
      max-width: 600px;
      width: 90%;
      backdrop-filter: blur(10px);
      animation: flipIn 0.7s ease-in-out;
    }
    @keyframes flipIn {
      from { transform: rotateY(90deg); opacity: 0; }
      to { transform: rotateY(0deg); opacity: 1; }
    }
    h2 {
      text-align: center;
      margin-bottom: 25px;
    }
    .input-group {
      position: relative;
      margin-top: 15px;
    }
    .input-group i {
      position: absolute;
      top: 60%;
      transform: translateY(-50%);
      left: 12px;
      color: var(--icon-color);
      font-size: 1em;
      pointer-events: none;
    }
    [dir="rtl"] .input-group i {
      left: auto;
      right: 12px;
    }
    .input-group label {
      display: flex;
      align-items: center;
      margin-bottom: 5px;
      margin-left: 30px;
      font-weight: bold;
      gap: 5px;
    }
    .input-group .asterisk {
      color: var(--asterisk-color);
      font-size: 0.8em;
      visibility: visible;
    }
    .input-group input,
    .input-group select,
    .input-group textarea {
      width: 100%;
      padding: 12px 12px 12px 38px;
      margin-top: 5px;
      border: 1px solid var(--input-border);
      border-radius: 8px;
      background: transparent;
      color: var(--text-color);
      transition: border 0.2s ease-in-out;
    }
    .input-group.invalid input,
    .input-group.invalid select,
    .input-group.invalid textarea {
      border-color: red;
    }
    [dir="rtl"] .input-group input,
    [dir="rtl"] .input-group select,
    [dir="rtl"] .input-group textarea {
      padding-left: 12px;
      padding-right: 38px;
    }
    button[type="submit"] {
      background-color: var(--button-bg);
      color: white;
      padding: 12px;
      margin-top: 20px;
      border: none;
      width: 100%;
      border-radius: 8px;
      font-size: 1.1em;
      cursor: pointer;
      transition: background 0.2s ease, transform 0.2s ease;
    }
    button[type="submit"]:hover {
      background-color: var(--button-hover);
      transform: translateY(-1px);
    }
    footer {
      background: transparent;
      padding: 30px 20px;
      text-align: center;
      font-size: 0.95em;
      color: var(--text-color);
      margin-top: auto;
      width: 100%;
      direction: ltr;
    }
    .footer-social {
      display: flex;
      justify-content: center;
      gap: 16px;
      margin-bottom: 10px;
    }
    .footer-social .icon {
      width: 28px;
      height: 28px;
      filter: invert(30%) sepia(20%) saturate(600%) hue-rotate(80deg);
      transition: transform 0.5s ease;
      transform-origin: center;
    }
    .footer-social .icon:hover {
      transform: rotateY(360deg) scale(1.3);
    }
  
#confirmationMessage {
  display: none !important;
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  text-align: center;
  animation: fadeInOut 6s ease-in-out forwards;
}
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); display: none; }
}


@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

input, textarea, select {
  background-color: var(--field-bg, #fff);
  color: inherit;
}


/* Mobile/Tablet Responsive Styles */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .form-container {
  background-color: rgba(0, 0, 0, 0.6); /* or use a variable like var(--form-bg) */
  backdrop-filter: blur(6px); /* Optional but nice */
  border-radius: 16px;
  padding: 2rem;
  }

  .input-row {
    flex-direction: column;
    gap: 10px;
  }

  .form-title {
    font-size: 1.4em;
    text-align: center;
  }

  .submit-button {
    width: 100%;
    font-size: 1em;
    padding: 12px;
  }

  .lang-switch, .theme-toggle {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
}

@media (max-width: 480px) {
  .form-title {
    font-size: 1.2em;
  }

  .input-group label {
    font-size: 0.95em;
  }

  .submit-button {
    padding: 10px;
    font-size: 0.95em;
  }

  input, select, textarea {
    font-size: 1em;
    padding: 10px;
  }
}



/* Polish enhancements for mobile */
@media (max-width: 768px) {
  .input-group {
    margin-bottom: 20px;
  }

  .confirmation {
    padding: 12px;
    font-size: 0.95em;
    line-height: 1.4;
  }

  .lang-switch, .theme-toggle {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
  }

  .lang-switch button, .theme-toggle button {
    font-size: 0.9em;
    padding: 8px 14px;
  }

  #upload {
    padding: 10px;
    font-size: 0.95em;
  }

  .file-warning {
    font-size: 0.85em;
    margin-top: 5px;
  }
}

@media (max-width: 480px) {
  .confirmation {
    font-size: 0.85em;
  }

  .form-title {
    font-size: 1.1em;
    margin-bottom: 10px;
  }

  .lang-switch button, .theme-toggle button {
    width: 100px;
  }
}
/* === Background Image Overlay === */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--bg-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 1;
}

html, body { overflow-x: clip; }


/* Set the image per theme */
body {
  --bg-img: url('/light_mode_strong_green.jpg'); /* or .png if you kept those */
}

body.dark {
  --bg-img: url('/dark_mode_lime_green.jpg');
}



/* === Placeholder alignment for RTL/LTR on phone input === */
#phone::placeholder { text-align: left; }
html[dir="rtl"] #phone::placeholder { text-align: right; }

/* Ensure input text also follows dir for visual consistency */
#phone { text-align: left; }
html[dir="rtl"] #phone { text-align: right; }



/* === POLISH: Buttons, focus, toast, animations === */
:root {
  --accent: #3aa655;
  --accent-dark: #2b7a3d;
  --danger: #d64545;
  --text-on: #ffffff;
}

button, .btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .08s ease, box-shadow .2s ease;
}
button:active, .btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--text-on);
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
}
.btn-primary:hover { background: var(--accent-dark); }

/* Focus ring */
:focus-visible {
  outline: 3px solid rgba(58,166,85,.4);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Inputs */
input, select, textarea {
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
  padding: 10px 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 4px rgba(58,166,85,.15);
  border-color: var(--accent);
}

/* Error text under fields */
.error-text {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  display: none;
}

/* Toast */
#toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  z-index: 9999;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
#toast.success { background: var(--accent-dark); }
#toast.error { background: var(--danger); }

/* Invalid shake (reduced motion respected) */
@media (prefers-reduced-motion: no-preference) {
  .shake {
    animation: shake .25s linear 1;
  }
  @keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
  }
}

#refIdWrap {
    position: fixed;
    top: 70px; /* a bit below the toast (toast is top:16px) */
    left: 50%;
    transform: translateX(-50%);
    background: #2b7a3d;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-family: sans-serif;
    font-size: 14px;
    display: none;
    z-index: 9999;
}

    #refIdWrap button {
        margin-left: 8px;
        padding: 4px 8px;
        font-size: 13px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }

#closeRefBtn {
    background: #d64545;
    color: #fff;
}

#copyRefBtn {
    background: #1a73e8;
    color: #fff;
}

.input-with-icon {
    position: relative;
}

    .input-with-icon > i {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        font-size: 14px;
        opacity: .9;
    }

    .input-with-icon > input {
        padding-left: 40px; /* keeps text clear of the icon */
    }

.help-inline {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    opacity: 0.85; /* subtle */
    line-height: 1.2;
    white-space: normal; /* prevent clipping like “eparate…” */
}


/* === Step 4 Polish === */
:root {
  --accent: #3aa655;
  --accent-dark: #2b7a3d;
}
/* Accent applied to primary actions and focus */
button, .btn { transition: transform .08s ease, box-shadow .2s ease, background .2s ease; }
button:hover, .btn:hover { box-shadow: 0 6px 16px rgba(0,0,0,.15); }
:focus-visible { outline: 3px solid rgba(58,166,85,.35); outline-offset: 2px; border-radius: 8px; }

/* Animated language switch (applied to #formContainer if present) */
#formContainer.animate-switch { animation: flipIn .6s ease both; }
@keyframes flipIn {
  0% { opacity: 0; transform: rotateX(-20deg) translateY(-6px); }
  100% { opacity: 1; transform: rotateX(0deg) translateY(0); }
}

/* Optional subtle hover for inputs */
input:hover, select:hover, textarea:hover { border-color: var(--accent); }

/* Theme color picker bubble */

