body {
  font-family: 'Segoe UI', Arial, sans-serif;
  max-width: 900px;
  margin: auto;
  padding: 1.5em;
  background: linear-gradient(135deg, #eef2ff 0%, #fafafa 100%);
}
h1, h2, h3 {
  text-align: center;
  color: #2d3556;
  margin-top: 0;
}
.instructions {
  margin-bottom: 1.2em;
  font-weight: bold;
  text-align: center;
  color: #455273;
}
/* --- Uppdateringar i main.css --- */

/* Generell knapp-stil i loginBox */
#loginBox button[type="submit"], 
#loginBox .back-btn, 
#initialChoice button {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
  border: 1px solid transparent;
}

/* Stilar för valknapparna (Logga in / Registrera) */
#initialChoice button {
    font-size: 1.1em;
    padding: 12px;
    margin-bottom: 8px; /* För att separera dem lite */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Logga in - knappen (Primär färg) */
#showLoginBtn, #loginBtn {
    background-color: #457af7; /* En fin blå färg */
    color: white;
    border-color: #3b6cd0;
}

#showLoginBtn:hover, #loginBtn:hover {
    background-color: #3b6cd0;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* Registrera - knappen (Sekundär färg) */
#showRegisterBtn {
    background-color: #5cb85c; /* En grön färg */
    color: white;
    border-color: #4cae4c;
}

#showRegisterBtn:hover {
    background-color: #4cae4c;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* "Tillbaka"-knappen (Sekundär/Diskret) */
.back-btn {
    background-color: #e0e0e0;
    color: #333;
    border: 1px solid #c0c0c0;
    font-size: 0.9em;
    padding: 8px;
    margin-top: 15px; /* Lite mer utrymme från formuläret */
}

.back-btn:hover {
    background-color: #d0d0d0;
    box-shadow: none;
    transform: translateY(0);
}

/* Standard Logga in/Registrera knapp inuti formulären */
#loginForm button[type="submit"], #registerForm button[type="submit"] {
    margin-top: 15px;
}

/* För att göra inloggnings- och registreringsknappen inuti formuläret mer framträdande */
#loginBtn, #registerBtn {
    margin-bottom: 0;
}
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6em;
  margin-bottom: 1em;
}
.candidate-card {
  background: #fff;
  border-radius: 7px;
  box-shadow: 0 1px 5px #bbc4e615;
  border: 1px solid #e4e8f3;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: box-shadow 0.13s, border 0.13s;
  cursor: pointer;
  padding: 0.45em 0.7em 0.22em 0.7em;
  font-size: 0.96em;
}
.candidate-card.selected {
  border: 2px solid #457af7;
  background: #eaf0ff;
}
.candidate-card.info-highlight {
  outline: 1.2px solid #457af7;
  box-shadow: 0 0 0 2px #a8c7fa33;
}
.candidate-card .card-top {
  padding: 0.25em 0 0.12em 0;
}
.candidate-name {
  font-size: 0.99em;
  font-weight: 700;
  margin-bottom: 0.13em;
}
.candidate-age {
  font-size: 0.92em;
}
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 0 0.25em 0;
  gap: 0.14em;
}
.btn-vote {
  flex:1;
  background: #457af7;
  color: #fff;
  border-radius: 4px;
  border: none;
  font-size: 0.97em;
  font-weight: bold;
  padding: 0.44em 0;
  cursor: pointer;
  box-shadow: 0 1px 3px #d1d9e626;
  transition: background 0.17s;
}
.btn-vote.selected {
  background: #3ca450;
}
.btn-vote[disabled] {
  background: #bbc4e6;
  color: #fff;
  cursor: not-allowed;
}
.btn-info {
  background: #dde2f3;
  color: #457af7;
  border: none;
  border-radius: 4px;
  font-size: 0.91em;
  font-weight: 600;
  padding: 0.28em 0.73em;
  cursor: pointer;
  transition: background 0.17s;
}
.btn-info.active,
.btn-info.active:focus {
  background: #457af7 !important;
  color: #fff !important;
  border: none;
}
#message {
  text-align: center;
  margin-top: 1em;
  font-weight: bold;
  color: #3f674b;
}
#main-flex { display: flex; flex-direction: row; gap: 1.2em; align-items: flex-start; }
#candidates {flex:2;}
#infoPanel {
  flex:1; min-width:230px; max-width:320px;
  background:#f6f7fb; border-radius:12px;
  border:1px solid #dde0ef; box-shadow:0 2px 8px #cfd5ed50;
  padding:0.7em; margin-top:0.5em; display:block;
  position:sticky; top:20px; height:max-content;
}
#infoPanelContent { color:#353f5e; font-size:1.08em; }
#infoPanelHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4em;
}
#closeInfoBtn {
  background: none;
  border: none;
  color: #888;
  font-size: 1.5em;
  cursor: pointer;
  margin-left: 1em;
  transition: color 0.2s;
  padding: 0;
}
#closeInfoBtn:hover { color: #d00; }

#selectedCandidatesBox {
  margin-top:1.2em;
  background: #eaf0ff;
  border-radius: 7px;
  padding: 0.6em 0.7em;
  font-size: 0.98em;
  color: #222e48;
  box-shadow: 0 1px 6px #dde2ff24;
}
#adminPanel {
  margin-top:2em;
  padding: 1em;
  border: 2px solid #333;
  border-radius: 12px;
  background: #fffbe7;
}
#adminCandidates li { margin-bottom: 7px; }
.cand-details { font-size: 0.95em; color: #444; margin-left: 0.5em; }
.admin-actions button { margin-left: 4px; }
#candidateForm input { margin-right: 10px; margin-bottom: 4px; }
#candidateForm { margin-bottom: 1em; }
.result-row { display: flex; justify-content: space-between; padding: 0.5em; border-bottom: 1px solid #ccc; }
.result-name { flex: 2; }
.result-points { font-weight: bold; flex: 1; }

@media (max-width: 700px) {
  #main-flex { 
    flex-direction: column;
    gap: 0;
  }
  #infoPanel {
    order: -1;
    position:static !important;
    min-width:unset; max-width:100%;
    margin-top:0;
    margin-bottom:1em;
  }
  .candidate-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.55em;
  }
}
