:root {
  --primary-blue: #001f54;
  --accent-gold: #f59e0b;
  --text-gray: #64748b;
  --light-border: #cbd5e1;
  --bg-fallback: #f4f6f9;
  --admin-red: #991b1b;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; }

/* ── Body — background image fills the right side always ── */
body {
  background-image: url("../img/backgroundimg.jpg");
  background-color: var(--bg-fallback);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  min-height: 100vh;
  overflow-y: auto;
}

/* ── Login panel — fluid width, shrinks on small screens ── */
.login-wrapper {
  width: clamp(300px, 35vw, 520px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  box-shadow: 4px 0 40px rgba(0,0,0,0.18);
  z-index: 10;
  min-height: 100vh;
  overflow-y: auto;
}

.login-card {
  background: transparent;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.card-header {
  background-color: var(--primary-blue);
  color: #ffffff;
  text-align: center;
  padding: clamp(20px, 3vh, 40px) clamp(16px, 2vw, 28px) clamp(16px, 2.5vh, 32px);
  border-bottom: 5px solid var(--accent-gold);
  transition: background-color 0.3s ease;
}
.card-header.admin-mode { background-color: var(--admin-red); }

.icon-container {
  margin-bottom: clamp(8px, 1.2vh, 16px);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: clamp(54px, 6vw, 82px);
  height: clamp(54px, 6vw, 82px);
  border: 3px solid var(--accent-gold);
  border-radius: 50%;
  overflow: hidden;
  background-color: white;
}
.logo-img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }

.card-header h1 {
  font-size: clamp(17px, 2vw, 26px);
  font-weight: 700; margin-bottom: 6px; letter-spacing: 0.5px;
}
.card-header h2 {
  font-size: clamp(9px, 0.9vw, 13px);
  color: var(--accent-gold); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
}

/* ── Form body ── */
.card-body {
  padding: clamp(16px, 3vh, 32px) clamp(16px, 3vw, 40px);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.input-group { margin-bottom: clamp(12px, 1.8vh, 20px); }
.input-row { display: flex; gap: 12px; }
.input-row .input-group { flex: 1; }

.input-group label {
  display: block; text-align: center;
  font-size: clamp(12px, 1vw, 14px);
  color: var(--text-gray); margin-bottom: 6px; font-weight: 600;
}
.input-group input {
  width: 100%;
  padding: clamp(9px, 1.2vh, 13px) clamp(12px, 1.2vw, 16px);
  border: 1px solid var(--light-border); border-radius: 8px;
  font-size: clamp(12px, 1vw, 14px); outline: none;
  transition: border-color 0.2s; text-align: center;
}
.text-left label { text-align: left; }
.text-left input { text-align: left; }
.input-group input:focus { border-color: var(--primary-blue); }

.btn {
  width: 100%;
  padding: clamp(10px, 1.4vh, 15px);
  border-radius: 8px;
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 700; cursor: pointer;
  transition: all 0.2s ease; outline: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background-color: var(--primary-blue); color: #ffffff; border: none; margin-top: 4px; }
.btn-admin { background-color: var(--admin-red); color: #ffffff; border: none; }
.btn-secondary { background-color: #ffffff; color: var(--primary-blue); border: 1.5px solid var(--primary-blue); }

.divider-container {
  text-align: center; margin: clamp(14px, 2vh, 24px) 0 clamp(12px, 1.6vh, 20px);
  position: relative;
}
.divider-container::before {
  content: ""; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background-color: #f1f5f9; z-index: 1;
}
.divider-container p {
  font-size: clamp(11px, 0.9vw, 13px); color: #94a3b8;
  background-color: #ffffff; padding: 0 10px;
  display: inline-block; position: relative; z-index: 2;
}

.footer-links {
  text-align: center; color: #94a3b8;
  font-size: clamp(11px, 0.9vw, 13px);
  background-color: #f8fafc;
  padding: clamp(12px, 1.8vh, 20px);
  border-top: 1px solid var(--light-border); margin-top: auto;
}
.admin-link {
  display: inline-flex; align-items: center; color: #64748b;
  text-decoration: none; margin-bottom: 6px; font-weight: 600; cursor: pointer;
}
.admin-link:hover { color: var(--primary-blue); }
.admin-link svg { width: 15px; height: 15px; margin-right: 6px; stroke: currentColor; }
.copyright { font-size: clamp(10px, 0.8vw, 12px); }

.role-selector { display: flex; gap: 12px; margin-bottom: clamp(14px, 2vh, 22px); }
.role-card {
  flex: 1; border: 1px solid var(--light-border); border-radius: 8px;
  padding: clamp(8px, 1vh, 12px); display: flex; flex-direction: column;
  align-items: center; cursor: pointer; transition: all 0.2s ease;
  color: var(--text-gray); font-size: clamp(11px, 0.9vw, 13px);
}
.role-card.active { border-color: var(--primary-blue); color: var(--primary-blue); background-color: #f8fafc; }

select#regProgram, select#regProgramFaculty {
  width: 100%;
  padding: clamp(9px, 1.2vh, 13px) clamp(12px, 1.2vw, 16px);
  border: 1px solid var(--light-border); border-radius: 8px;
  font-size: clamp(12px, 1vw, 14px); outline: none;
  transition: border-color 0.2s; text-align: left;
  background: #fff; color: #1e293b; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; cursor: pointer;
}
select#regProgram:focus, select#regProgramFaculty:focus { border-color: var(--primary-blue); }

#msgBox {
  display: none; position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background-color: var(--primary-blue); color: white;
  padding: clamp(10px, 1.4vh, 16px) clamp(16px, 2vw, 24px);
  border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  z-index: 1000; font-size: clamp(12px, 1vw, 15px); text-align: center;
  min-width: 220px; animation: slideDown 0.3s ease-out;
}
@keyframes slideDown { from { top: -50px; opacity: 0; } to { top: 20px; opacity: 1; } }

/* ── Announcement panel ── */
.announce-panel {
  position: fixed; top: 20px; right: 20px; z-index: 500;
  width: clamp(220px, 20vw, 300px);
  display: flex; flex-direction: column; pointer-events: auto;
}
.announce-toggle {
  background: var(--primary-blue); color: white; border: none;
  padding: clamp(8px, 1vh, 11px) clamp(10px, 1vw, 16px);
  border-radius: 10px; cursor: pointer;
  font-size: clamp(11px, 0.9vw, 13px); font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  transition: border-radius 0.2s;
}
.announce-panel.open .announce-toggle { border-radius: 10px 10px 0 0; border-bottom: 2px solid var(--accent-gold); }
.announce-toggle span { display: flex; align-items: center; gap: 7px; }
.announce-chevron { transition: transform 0.2s; flex-shrink: 0; }
.announce-panel.open .announce-chevron { transform: rotate(180deg); }
.announce-body {
  background: white; border-radius: 0 0 10px 10px;
  border: 2px solid var(--accent-gold); border-top: none;
  max-height: clamp(200px, 30vh, 360px); overflow-y: auto; display: none;
}
.announce-panel.open .announce-body { display: block; }
.announce-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  color: #94a3b8; padding: 8px 12px 4px; border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; gap: 5px;
}
.announce-item {
  padding: clamp(7px, 1vh, 10px) clamp(10px, 1vw, 14px);
  border-bottom: 1px solid #f1f5f9; display: flex; gap: 8px; align-items: flex-start;
}
.announce-item:last-child { border-bottom: none; }
.announce-dot-event { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; flex-shrink: 0; margin-top: 4px; }
.announce-dot-reminder { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-gold); flex-shrink: 0; margin-top: 4px; }
.announce-msg { font-size: clamp(11px, 0.9vw, 13px); color: #1e293b; line-height: 1.45; font-weight: 500; }
.announce-date { font-size: clamp(10px, 0.8vw, 11px); color: #64748b; margin-top: 2px; }
.announce-empty { padding: 12px; font-size: clamp(11px, 0.9vw, 13px); color: #94a3b8; text-align: center; }

/* ── Responsive ── */

/* ── Bible verse card ── */
.bible-verse {
  position: fixed; bottom: clamp(16px,2vh,28px); right: clamp(16px,2vw,32px);
  z-index: 5; pointer-events: none;
  width: clamp(260px, 22vw, 340px);
}
.bible-card {
  background: rgba(0,20,60,0.88);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: clamp(14px,1.6vh,20px) clamp(16px,1.6vw,22px);
  border-left: 4px solid #f59e0b;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}
.bible-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bible-header svg { flex-shrink: 0; width: 16px; height: 16px; }
.bible-header span {
  font-size: clamp(9px,0.72vw,11px); font-weight: 800;
  letter-spacing: 1.8px; color: #f59e0b; text-transform: uppercase;
}
.bible-text {
  font-size: clamp(13px,1.05vw,16px); color: rgba(255,255,255,0.95);
  font-style: italic; line-height: 1.65; margin-bottom: 12px;
}
.bible-ref { display: flex; align-items: center; gap: 8px; }
.bible-line { flex: 1; height: 1px; background: rgba(245,158,11,0.35); }
.bible-ref span {
  font-size: clamp(11px,0.88vw,13px); color: #f59e0b;
  font-weight: 700; letter-spacing: 0.3px; white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .login-wrapper { width: clamp(300px, 44vw, 460px); }
  .bible-verse { width: clamp(240px,20vw,300px); }
}
@media (max-width: 900px) {
  .login-wrapper { width: clamp(300px, 54vw, 400px); }
  .announce-panel { width: clamp(200px,30vw,260px); }
  .bible-verse { display: none; }
}
@media (max-width: 768px) {
  body { flex-direction: column; }
  .login-wrapper { width: 100%; max-width: 100%; min-height: auto; box-shadow: none; }
  .card-header { padding: clamp(20px,4vw,32px) clamp(14px,4vw,24px) clamp(16px,3vw,24px); }
  .card-header h1 { font-size: clamp(16px,4vw,22px); }
  .card-header h2 { font-size: clamp(9px,2vw,12px); }
  .icon-container { width: clamp(52px,12vw,68px); height: clamp(52px,12vw,68px); }
  .card-body { padding: clamp(16px,4vw,28px) clamp(14px,5vw,32px); }
  .input-group label { font-size: clamp(12px,3vw,14px); }
  .input-group input { font-size: clamp(13px,3vw,15px); padding: clamp(10px,2.5vw,14px) clamp(12px,3vw,16px); }
  .btn { font-size: clamp(13px,3.5vw,15px); padding: clamp(11px,3vw,14px); }
  .footer-links { padding: clamp(12px,3vw,18px); }
  select#regProgram, select#regProgramFaculty { font-size: clamp(12px,3vw,14px); }
  .announce-panel { position: static; width: 100%; z-index: auto; border-bottom: 2px solid var(--accent-gold); }
  .announce-toggle { border-radius: 0; font-size: 12px; padding: 9px 14px; }
  .announce-panel.open .announce-toggle { border-radius: 0; border-bottom: 2px solid var(--accent-gold); }
  .announce-body { border-radius: 0; border-left: none; border-right: none; border-bottom: none; max-height: 160px; }
  .bible-verse { display: none; }
}
@media (max-width: 420px) {
  .card-header h1 { font-size: 15px; }
  .card-header h2 { font-size: 9px; }
  .card-header { padding: 18px 12px 14px; }
  .icon-container { width: 48px; height: 48px; }
  .card-body { padding: 14px; }
  .input-group { margin-bottom: 12px; }
  .btn { padding: 11px; font-size: 13px; }
  .role-card { padding: 7px 3px; font-size: 11px; }
  .role-selector { gap: 8px; }
  .footer-links { padding: 10px 12px; }
  select#regProgram, select#regProgramFaculty { padding: 10px 12px; font-size: 12px; }
}
@media (max-width: 320px) {
  .card-header h1 { font-size: 13px; }
  .icon-container { width: 42px; height: 42px; }
  .input-group input { padding: 9px 10px; }
}
@media (min-width: 1600px) {
  .login-wrapper { width: clamp(420px, 28vw, 560px); }
  .announce-panel { width: 320px; top: 28px; right: 28px; }
  .bible-verse { width: 340px; }
}
