/* =========================================================
   CCRMS – styles.css (LIGHT BLUE / PROFESSIONAL)
   - Hintergrund: helles Blau (nicht weiß)
   - Text: dunkel (praktisch schwarz)
   - Cards/Flächen: leicht gebrochenes Weiß/Blaugrau
   - Buttons: dunkleres Blau
   ========================================================= */

/* ---------- Design Tokens / Variables ---------- */
:root{
  /* Base */
  --bg: #e9f0fb;              /* page background (light blue) */
  --bg2: #e3ecfb;             /* subtle variation */
  --surface: #f3f6fc;         /* cards/panels (not pure white) */
  --surface2: #eef3fb;        /* slightly darker surface */
  --surface3: #e8effb;        /* header/table head */

  /* Text */
  --text: #0b1220;            /* near-black */
  --muted: rgba(11, 18, 32, .68);
  --muted2: rgba(11, 18, 32, .52);

  /* Lines / Shadows */
  --line: rgba(11, 18, 32, .14);
  --line2: rgba(11, 18, 32, .10);
  --shadow: 0 18px 40px rgba(11, 18, 32, .10);
  --shadow2: 0 10px 22px rgba(11, 18, 32, .08);

  /* Brand */
  --primary: #1e40af;         /* blue-800 */
  --primary2: #1d4ed8;        /* blue-700 */
  --primarySoft: rgba(29, 78, 216, .12);
  --focus: rgba(29, 78, 216, .20);

  /* Status */
  --ok: #16a34a;
  --err: #dc2626;

  /* Radius */
  --radius: 16px;

  /* Browser hint for light UI controls */
  color-scheme: light;
}

/* ---------- Reset / Base ---------- */
*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial;
  color: var(--text);

  /* Subtle clean background */
  background:
    radial-gradient(1100px 600px at 15% 10%, rgba(29,78,216,.10), transparent 62%),
    radial-gradient(900px 520px at 90% 18%, rgba(30,64,175,.08), transparent 58%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg) 55%, #e6effc 100%);
}

/* ---------- Typography ---------- */
.title{
  margin: 0;
  font-size: 28px;
  letter-spacing: .2px;
  color: var(--text);
}

.subtitle{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tiny{
  margin: 0;
  color: var(--muted2);
  font-size: 12px;
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: rgba(11, 18, 32, .78);
}

/* ---------- Generic Layout ---------- */
.page{
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.card{
  width: min(520px, 100%);
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__header{
  padding: 26px 26px 10px;
}

.card__footer{
  padding: 14px 26px 22px;
  border-top: 1px solid var(--line2);
  background: rgba(11,18,32,.03);
}

/* ---------- Tabs (Login/Register) ---------- */
.tabs{
  padding: 12px 18px 0;
}

.tabs__radio{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tabs__label{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  margin: 0 6px 10px 0;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: rgba(255,255,255,.35); /* not pure white look */
  color: rgba(11,18,32,.85);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}

.tabs__label:hover{
  border-color: var(--line);
  background: rgba(255,255,255,.48);
}

.tabs__label:active{
  transform: translateY(1px);
}

/* both tabs highlight in same blue family */
#tab-login:checked + .tabs__label,
#tab-register:checked + .tabs__label{
  border-color: rgba(29,78,216,.40);
  background: rgba(29,78,216,.12);
}

.tabs__panels{
  margin-top: 10px;
  padding: 0 8px 18px;
}

.panel{ display: none; }
#tab-login:checked ~ .tabs__panels .panel--login{ display: block; }
#tab-register:checked ~ .tabs__panels .panel--register{ display: block; }

/* ---------- Forms ---------- */
.form{
  padding: 18px;
  border-radius: calc(var(--radius) - 6px);
  background: rgba(255,255,255,.32); /* NOT full white */
  border: 1px solid var(--line2);
}

.field{ margin-bottom: 14px; }

.field__label{
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  color: rgba(11,18,32,.82);
}

.field__input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(11,18,32,.16);
  background: rgba(255,255,255,.45);
  color: var(--text);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.field__input:hover{
  border-color: rgba(11,18,32,.22);
  background: rgba(255,255,255,.55);
}

.field__input::placeholder{ color: rgba(11,18,32,.42); }

.field__input:focus{
  border-color: rgba(29,78,216,.50);
  box-shadow: 0 0 0 4px var(--focus);
  background: rgba(255,255,255,.62);
}

.field__help{
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(11,18,32,.60);
}

/* 2-col grid for forms */
.grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px){
  .grid{ grid-template-columns: 1fr; }
}

/* Rows / checkbox helper */
.row{
  display: flex;
  gap: 12px;
  align-items: center;
}

.row--between{
  justify-content: space-between;
  margin: 6px 0 14px;
}

.checkbox{
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: rgba(11,18,32,.80);
  font-size: 13px;
}

.checkbox--stack{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 14px;
}

.checkbox input{
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--primary2);
}

.link{
  color: rgba(11,18,32,.88);
  text-decoration: underline;
  text-decoration-color: rgba(11,18,32,.25);
  text-underline-offset: 3px;
}

.link:hover{
  text-decoration-color: rgba(11,18,32,.55);
}

.link--as-label{ cursor: pointer; }

/* ---------- Buttons ---------- */
.btn{
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 650;
  letter-spacing: .2px;
  cursor: pointer;
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}

.btn:active{ transform: translateY(1px); }

.btn--primary{
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  box-shadow: 0 14px 26px rgba(29,78,216,.18);
}

.btn--primary:hover{ filter: brightness(1.03); }

.btn--ghost{
  background: rgba(255,255,255,.40);
  color: rgba(11,18,32,.90);
  border: 1px solid rgba(11,18,32,.16);
  box-shadow: none;
}

.btn--ghost:hover{ filter: brightness(1.05); }

/* small action buttons (table header etc.) */
.btn--mini{
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
  height: auto;
  border-radius: 8px;
  box-shadow: none;
}

/* Button rows default */
.btn-row{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons in rows should NOT be full width */
.btn-row .btn,
.panel-card .btn{
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
}

/* BUT in forms (Login/Register) buttons stay full width */
.form .btn{
  width: 100%;
}

/* label.btn behaves like a button */
label.btn{ user-select: none; }

/* ---------- Messages ---------- */
.msg{
  margin: 0 26px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(11,18,32,.16);
  background: rgba(255,255,255,.32);
  color: rgba(11,18,32,.92);
  font-size: 13px;
  display: none;
}

.msg--ok{
  border-color: rgba(22,163,74,.28);
  background: rgba(22,163,74,.08);
}

.msg--err{
  border-color: rgba(220,38,38,.28);
  background: rgba(220,38,38,.07);
}

/* =========================================================
   Dashboard Layout
   ========================================================= */
.page--dashboard{
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 10;

  background:
    linear-gradient(
      180deg,
      #c7d6f1 0%,
      #bfcee9 100%
    );

  border-bottom: 1px solid rgba(11,18,32,.28);
}


.topbar__inner{
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__title{
  margin: 0;
  font-size: 18px;
  letter-spacing: .2px;
  color: var(--text);
}

.brand__sub{
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.container{
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 16px 30px;
}

.grid-2{
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
}

@media (max-width: 900px){
  .grid-2{ grid-template-columns: 1fr; }
}

.panel-card{
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  border: 1px solid rgba(11,18,32,.10);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow2);
}

/* forms inside panel-card should not add default margins */
.panel-card form{ margin: 0; }

.panel-title{
  margin: 0 0 10px;
  font-size: 16px;
  color: rgba(11,18,32,.92);
}

/* ---------- Tables ---------- */
.table-wrap{
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(11,18,32,.10);
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  box-shadow: var(--shadow2);
}

.table{
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px; /* prevent mobile squish; wrapper scrolls */
  font-size: 13px;
  color: rgba(11,18,32,.92);
}

.table th, .table td{
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(11,18,32,.08);
  vertical-align: top;
  white-space: nowrap;
}

.table thead th{
  position: sticky;
  top: 0;
  background: rgba(232,239,251,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(11,18,32,.10);
  font-size: 12px;
  color: rgba(11,18,32,.78);
}

.table tbody tr:hover{
  background: rgba(29,78,216,.05);
}

.badge{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(11,18,32,.14);
  background: rgba(255,255,255,.40);
  font-size: 12px;
  color: rgba(11,18,32,.86);
}

/* Dashboard: checkbox inputs should NOT look like .field__input */
input[type="checkbox"]{
  width: auto !important;
  min-width: 0 !important;
  display: inline-block !important;
}

/* =========================================================
   Rewards (Prämien) – Verwaltung (praemien.php)
   ========================================================= */
.rewards-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1000px){
  .rewards-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .rewards-grid{ grid-template-columns: 1fr; }
}

.reward-add{
  border: 1px dashed rgba(11,18,32,.20);
  background: rgba(255,255,255,.28);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  color: rgba(11,18,32,.88);
  display: grid;
  place-items: center;
  min-height: 220px;
  transition: filter .12s ease, border-color .12s ease, background .12s ease;
}

.reward-add:hover{
  filter: brightness(1.02);
  border-color: rgba(29,78,216,.28);
  background: rgba(255,255,255,.36);
}

.reward-add__plus{
  font-size: 54px;
  line-height: 1;
  opacity: .85;
}

.reward-add__text{
  margin-top: 6px;
  font-size: 13px;
  color: rgba(11,18,32,.68);
}

.reward-card{
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(11,18,32,.10);
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow2);
}

.reward-thumb{
  position: relative;
  height: 160px;
  overflow: hidden;
  background: rgba(11,18,32,.06);
  display: grid;
  place-items: center;
}

.reward-thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}


.reward-thumb__placeholder{
  color: rgba(11,18,32,.62);
  font-size: 12px;
}

.reward-meta{
  padding: 12px 12px 14px;
  background: transparent;
}

.reward-title{
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  color: rgba(11,18,32,.92);
  margin-bottom: 6px;
}

/* Safety: no overlay text inside thumb */
.reward-thumb .reward-title{ display: none; }

/* =========================================================
   Modal
   ========================================================= */
.modal{ display:none; }
.modal--open{ display:block; }

.modal__backdrop{
  position: fixed;
  inset: 0;
  background: rgba(11,18,32,.45);
}

.modal__panel{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 24px));
  border-radius: var(--radius);
  border: 1px solid rgba(11,18,32,.12);
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  padding: 16px;
  box-shadow: 0 22px 60px rgba(11,18,32,.22);
}

/* =========================================================
   Rewards Picker (refer.php)
   ========================================================= */
.rewards-pick{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 900px){
  .rewards-pick{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .rewards-pick{ grid-template-columns: 1fr; }
}

.reward-pick{
  text-align: left;
  border: 1px solid rgba(11,18,32,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,.22));
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  color: rgba(11,18,32,.90);

  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: border-color .12s ease, box-shadow .12s ease, filter .12s ease;
}

.reward-pick:hover{
  filter: brightness(1.02);
  border-color: rgba(29,78,216,.20);
}

.reward-pick__img img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}


.reward-pick__img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reward-pick__title{
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  min-height: 44px; /* ~2 lines */
  white-space: normal;
  overflow: hidden;
}

.reward-pick--active{
  border-color: rgba(29,78,216,.40);
  box-shadow: 0 0 0 4px rgba(29,78,216,.14);
}

/* Required reward feedback */
.reward-pick--error{
  animation: shake .35s;
  border-color: rgba(220,38,38,.55);
}

@keyframes shake{
  0%{ transform: translateX(0); }
  25%{ transform: translateX(-3px); }
  50%{ transform: translateX(3px); }
  75%{ transform: translateX(-3px); }
  100%{ transform: translateX(0); }
}

/* --- Ja/Nein Picker (Step 3) --- */
#yesNoPick .reward-pick{
  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255,255,255,.28);
  border: 1px solid rgba(11,18,32,.14);
  color: rgba(11,18,32,.88);

  min-height: 20px;
  padding: 1px 2px;
  text-align: center;
}

#yesNoPick .reward-pick__title{
  width: 100%;
  margin: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
}

#yesNoPick .reward-pick--active{
  border-color: rgba(29,78,216,.28);
  background: rgba(29,78,216,.10);
  box-shadow: 0 0 0 4px rgba(29,78,216,.10);
}

#yesNoPick .reward-pick:hover{
  background: rgba(255,255,255,.36);
  border-color: rgba(29,78,216,.22);
}

/* =========================================================
   Wizard (refer.php)
   ========================================================= */
.wizard__bar{
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.30);
  border: 1px solid rgba(11,18,32,.10);
  overflow: hidden;
}

.wizard__fill{
  height: 100%;
  background: rgba(29,78,216,.70);
  transition: width .25s ease;
}

.wizard__steps{
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.wizard__step{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  border: 1px solid rgba(11,18,32,.14);
  background: rgba(255,255,255,.28);
  color: rgba(11,18,32,.78);
}

.wizard__step--active{
  border-color: rgba(29,78,216,.35);
  box-shadow: 0 0 0 4px rgba(29,78,216,.12);
  color: rgba(11,18,32,.92);
}

.wizard__step--done{
  border-color: rgba(22,163,74,.35);
  color: rgba(11,18,32,.88);
}

/* =========================================================
   Select (light UI fix)
   ========================================================= */
select.field__input{
  background-color: rgba(255,255,255,.45) !important;
  color: rgba(11,18,32,.95) !important;
  border: 1px solid rgba(11,18,32,.16) !important;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding-right: 36px;
}

select.field__input option{
  background-color: #f3f6fc;
  color: rgba(11,18,32,.95);
}

select.field__input{
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(11,18,32,.55) 50%),
    linear-gradient(135deg, rgba(11,18,32,.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select.field__input:focus{
  outline: none;
  border-color: rgba(29,78,216,.50) !important;
  box-shadow: 0 0 0 4px rgba(29,78,216,.14);
}
