:root {
    --bg: #ffffff;
    --card: #12141a;
    --muted: #9aa0aa;
    --text: #454545;
    --accent: #0052d7;
    --danger: #FC3333;
    --sinine: #0052d7;
    --a1: #5a00d5;
/*    --a1: #8B00D5;;*/
    --a2: #64FFA1;
    --a1l: #DCB9EF;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Lexend Deca", sans-serif!important;
}
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("assets/sulg_back.svg");
  background-repeat: no-repeat;
  background-position: 0px 100px;
  background-size: cover;
  z-index: -1; /* jääb sisu taha */
}
/* Video täisekraanil taustana */
#bgVideo {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  z-index: -1;
    filter: blur(6px) brightness(1); 
}


.container, .header, .footer {
  position: relative;
/*  z-index: 1; */
}
ul, ol {
  padding-inline-start: 0;
  margin: 0; /* kui tahad ka vaikimisi margini eemaldada */
  list-style-position: inside; /* valikuline */
}
.header {
    display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 16px;
background: var(--a1);
color: var(--a1l);
 border-bottom: 1px solid #ffffff; 
position: sticky;
top: 20px;
z-index: 10;
margin: 16px;
border-radius: 50px;
}
.card .header {
    background: #e2e2e2;
}
.logo {
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: -8px;
}

.user .link {
    margin-left: 8px
}

.container {
    max-width: 800px;
    margin: 0px auto;
    padding: 0 16px
}

#loginBox, #regBox {
    padding: 20px;
}
.hidden {
    display: none
}

.row {
    display: flex;
    gap: 8px;
    align-items: center
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px
}


button {
  
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #2a3244;
    background: #0f1219;
    color: var(--a2);
}
input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #2a3244;
    background: #0f1219;
    color: var(--text);
}
button {
    cursor: pointer
}

button.primary {
    background: var(--accent);
    border: none;
    color: #05222b;
    font-weight: 700
}

button.danger {
    background: var(--danger);
    border: none;
    border-radius: 50%!important;
    font-size: 13px;
    width: 30px;
    height: 30px;
        
}

button.small {
    padding: 6px 10px;
    border-radius: 8px
}

button.link {
    background: transparent;
    border: none;
    color: var(--accent);
    
}

.msg {
    color: var(--muted);
    margin-top: 8px
}

.hint {
    color: var(--muted);
    font-size: 14px
}

.muted {
    color: var(--a1l)
}

.toolbar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    z-index: 100;
}

.stats {
    padding: 0px 10px;
font-weight: 300;
text-align: center;
}
#statsBox h2 {
    font-weight: 500;
    color: var(--a1);
}
/*
.statWrap {
    padding: 10px;
    background-color: aliceblue;
}
*/
#statsBox ol li {
    font-size: 12px;
}

h4 {
    margin: 20px 0 5px 0;
}
.training .header {
display: flex;
justify-content: space-between;
gap: 8px;
background: #ffffff;
color: #204f65;
border-radius: 10px 10px 0 0;
}

.training .meta .title {
    font-weight: 300
}
.meta {
 font-size: 16px;
    align-content: center;
height: 55px;
    font-weight: 350;
}
.meta span {

}
.training .note {
  margin: 10px 0;
padding: 0 15px;
    font-weight: 300;
    color: var(--text);
}

#toggleCreate {
    font-size: 25px;
font-weight: 600;
    transform: scale(1);
    will-change: transform;
    animation: scaleAnim 2.2s ease-in-out infinite;
}
@keyframes scaleAnim {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.participants {
    list-style: none;
/*    padding: 10px;*/
    margin: 15px 0 15px 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
/*    gap: 6px*/
}
.participants li{
   border-bottom:1px solid #e4e4e4; 
    display: flex;
    flex-direction: row;
justify-content: space-between;
    padding: 7px 15px;

}
.avatar {
  display: inline-flex;
align-items: center;
justify-content: center;
width: 23px;
height: 23px;
border-radius: 50%;
background: #aaaaaa;
color: #fff;
font-size: 12px;
font-weight: 300;
/* padding: 7px; */
margin-right: 4px;
}
.creator {
   font-size: 16px;
font-weight: 300;
}
.today-label {
position: absolute;
top: -30px;
left: 62px;
padding: 5px 10px;
border-radius: 10px 10px 0 0;
background-color: #FFCF64;
color: var(--a1);
box-shadow: 0 4px 10px rgba(0,0,0,0.08);
will-change: transform;
animation: todayBob 2s ease-in-out infinite;
box-shadow: 0 -1.971343994140625px 5px -2px rgb(152, 80, 0) inset;
}

/* pehme üles-alla kiigutus */
@keyframes todayBob {
  0%   { transform: translateY(0) rotate(3deg); padding-bottom: 5px; }
  50%  { transform: translateY(-3px) rotate(0deg); padding-bottom: 8px;}
  100% { transform: translateY(0) rotate(3deg); padding-bottom: 5px;}
}
/*
.participants li:hover{
    background: #f8f8f8;
}
*/
.participants li button{
   color: red;
    padding: 0;
}
.card .header .meta .title span, .card .header .meta .sub span {
    margin-right: 15px;
    font-weight: 300
}

.card .header .meta .title span svg,
.card .header .meta .sub span svg{
    margin-right: 5px;
     color: #cbd5e1;
}
.join-wrap {
    padding: 10px;
    display: flex;
    align-items: center;
    
}
.join-wrap input[type="text"]{
 width: 100%;
padding: 10px 10px!important;
margin-bottom: 0!important;
border: 1px solid #ddd;
border-radius: 20px 0 0 20px!important;
font-size: 13px!important;
background: #fafafa;
transition: border-color 0.2s, background 0.2s;
border: 0px solid #ddd!important;
font-weight: 300;
}
.join-wrap button{
  background-color: var(--a1)!important;
font-weight: 300;
font-size: 14px;
color: var(--a2);
border-radius: 0 20px 20px 0!important;
padding: 10px 20px!important;
}
.header .meta button {
    position: absolute;
    top:-5px;
    right: -5px;
    font-size: 13px;
}
.training-header {
    background-color:  var(--a2);
    color: var(--a1);
    border-radius: 35px;
    position: relative;
     height: 55px;
    padding-left: 65px;
}
.training-header .danger {
    position: absolute;
    top:-5px;
    right:0px;
}
.kuupaev {
   background-color:  var(--a1); 
   color:  var(--a2); 
    position: absolute;
    left: 0;
    top:0;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 300;
}
.kuupaev .kp {
  font-size: 24px;
    font-weight: 400;
}
.kuupaev .np {
  margin-bottom: -8px;
}
.kuupaev .kuu {
  margin-top: -5px;
}
.trenni-info {
    display: flex;
    flex-direction: column;
}
.toast.error {
  background: #FFCF64;
}
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* täpselt keskele */
  
  background: rgba(51, 51, 51, 0.85);
  color: #fff;
  padding: 14px 28px;
  border-radius: 32px;
  font-size: 28px;
  line-height: 1.2;
  text-align: center;

  opacity: 0;
  pointer-events: none;
  z-index: 9999;

  /* animatsiooni algolek */
  transform: translate(-50%, -60%);
  transition: opacity 0.4s ease, transform 0.4s ease;
  box-shadow: 4px 4px 40px var(--a1);
border-top: 1px solid rgba(255, 255, 255, 0.63);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%); /* liigub kergelt üles */
}

/* edukas (roheline läige) */
.toast.success {
  background: linear-gradient(
    135deg,
    #64FFA1 0%,
    #09e660 25%,
    #64FFA1 50%,
    #09e660 75%,
    #64FFA1 100%
  
  );
  color: #fff;
  background-size: 200% 200%;
  animation: shine 2s linear infinite;
}

/* error (punane läige) */
.toast.error {
  background: linear-gradient(
    135deg,
    #ffe3a5 0%,
    #FFCF64 25%,
    #ffe3a5 50%,
    #FFCF64 75%,
    #ffe3a5 100%
  );
  color: #000;
  background-size: 200% 200%;
  animation: shine 2s linear infinite;
}

/* shine animatsioon */
@keyframes shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}


.badge {
 
    color: var(--a1);
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 3px;
    font-size: 13px
}
.badgeBG {
 
    background-color: var(--a1l);
    color: var(--a1);
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 3px;
    font-size: 11px
}
.add-guest {
    text-align: center;
}
.add-guest .link{
    text-decoration: none;
}

.icon {
    background: transparent;
    border: none
}

.footer {
    padding: 24px;
    color: var(--muted);
    text-align: center;
/*    border-top: 1px solid #1a1f2b;*/
    margin-top: 40px
}
.error-msg { margin-top: 4px; color: red; font-size: 14px; }
.comment {
 color: #666;
font-style: italic;
margin-left: 5px;
width: 100%;
font-weight: 300;
font-size: 13px;
    align-items: center;
}
/* --- Üldine kaardi stiil --- */

#createForm {
    padding: 20px;
}

.card {
border-radius: 35px;
margin: 2.5rem 0px;
/* max-width: 600px; */
transition: all 0.2s ease,
border: 1px solid #ffffff;
background-color: rgba(255, 255, 255, 0);
-webkit-backdrop-filter: blur(7px) brightness(90%);
backdrop-filter: blur(5px) brightness(92%);
padding-bottom: 13px;
    cursor: default;
}


.card.hidden {
  display: none;
}

/* --- Pealkirjad --- */
.card h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #333;
  text-align: center;
}

/* --- Sisendväljad --- */
.card input[type="text"], .card input[type="email"], .card input[type="password"], .card textarea, .card select {
width: 100%;
padding: 0.7rem 1rem;
margin-bottom: 0.8rem;
border: 1px solid #ddd;
border-radius: 35px;
font-size: 1rem;
background: #fafafa;
transition: border-color 0.2s, background 0.2s;
}

.card input:focus,
.card textarea:focus,
.card select:focus {
  outline: none;
  border-color: var(--sinine); /* sinine aktsent */
  background: #fff;
  box-shadow: 0 0 0 0px var(--sinine);
}
/* === Input & Select === */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
/*  margin: 6px 0;*/
  font-size: 1rem;
  font-family: inherit;

  border: 2px solid #ddd;
  border-radius: 12px;
  background-color: #fafafa!important;
  color: #333;

  transition: all 0.2s ease;
  box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--a1); /* fallback kui var pole */
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(0, 82, 215, 0.2);
}

/* placeholderi toon */
input::placeholder,
textarea::placeholder {
  color: #aaa;
  font-style: italic;
}

/* Select eristiil */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23333' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-right: 40px;
}

/* Tekstiala */
textarea {
  resize: vertical;
  min-height: 80px;
}

/* Väike animatsioon hoveril */
input:hover,
textarea:hover,
select:hover {
  border-color: #bbb;
}
/* --- Nupud --- */
button {
  padding: 0.6rem 1.2rem;
  border-radius: 35px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s, transform 0.1s;
    font-family: "Lexend Deca", sans-serif!important;
}

button.primary {
  color: var(--a2);
 background-color: #163727;
    border-radius: 25px;
}

/*
button.primary:hover {
  background: var(--sinine);
}
*/

button.link {
  background: none;
  color: var(--a1);
  text-decoration: underline;
  padding: 0.4rem 0.8rem;
}
button.link-ondark {
     color: var(--a1l);
}

button:hover {
  transform: translateY(-1px);
}

/* --- Ridade paigutus --- */
.row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
    padding: 10px 0;
}

/* --- Abitekstid --- */
.hint {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}
/** === Modal === */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end; /* alati alt */
  background: rgba(0,0,0,.35);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal.hidden {
  display: none; /* fallback */
}

.modal-content {
  width: 100%;
  max-width: 800px;
  background: #fff;
  padding: 1.5rem;
  border-radius: 35px 35px 0 0;
  box-shadow: 0 -8px 88px rgba(0,0,0,0.49);

  transform: translateY(100%);
  opacity: 0;
}

/* avamisel */
.modal.open .modal-content {
  animation: slideUp .3s cubic-bezier(.25,.8,.25,1) forwards;
}

/* sulgemisel */
.modal.closing .modal-content {
  animation: slideDown .25s cubic-bezier(.4,.0,.6,1) forwards;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}

.modal-content .close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 1.4rem;
  border: none;
  background: none;
  cursor: pointer;
}
.flatpickr-input {
/*    width:50%!important;*/
}
.msg {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* Edu ja vead */
.msg.success { color: #16a34a; }
.msg.error { color: #dc2626; }

/* Üldine checkboxi konteiner */
.card input[type="checkbox"] {
  /* peida vaikimisi ruut */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
}

/* Hover efekt */
.card input[type="checkbox"]:hover {
  border-color: var(--sinine);
}

/* Fookus */
.card input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--sinine);
}

/* Kui valitud */
.card input[type="checkbox"]:checked {
  background-color: var(--sinine);
  border-color: var(--sinine);
}

/* Märk valitud olekus */
.card input[type="checkbox"]:checked::after {
  content: "✓";
  color: #fff;
  font-size: 14px;
  position: absolute;
  top: -1px;
  left: 2px;
}
@media (max-width:680px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .participants {
        grid-template-columns: repeat(1, 1fr);
    }
    .training .header {
        flex-direction: column;
        align-items: flex-start
    }
}