:root{
  --dark-blue:#0b1a37;
  --red:#bc0404;
  --text-dark:#333333;
  --text-light:#ffffff;
  --input-border:#d1d5db;
  --error-bg:#fee2e2;
  --error-text:#b91c1c;
  --radius:15px;
  --shadow:0 30px 50px rgba(0,0,0,.40);
  --card-w:800px;
  --card-h:450px;
  --gap:15px;
  --pad-lg:50px;
  --pad-md:40px;
  --pad-sm:25px;
  --focus-ring:0 0 0 2px rgba(188,4,4,.20);
}

/* ===== Base ===== */
*{ box-sizing:border-box; }

html, body{
  margin:0;
  padding:0;
  height:100%;
  font-family:'Roboto',sans-serif;
  color:var(--text-dark);
}

body.login-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;

  background:
    linear-gradient(rgba(10,25,54,.50), rgba(134,6,6,.31)),
    url('images/Background.png') left center / cover no-repeat;
  background-attachment:fixed;
}

/* ===== Card ===== */
.page{
  width:var(--card-w);
  height:var(--card-h);
  max-width:90%;
  display:flex;
  overflow:hidden;
  border-radius:var(--radius);

  background:
    linear-gradient(rgba(7,34,88,.50), rgba(134,6,6,.31)),
    url('images/bg.png') center / cover no-repeat;
  background-blend-mode:overlay;

  box-shadow:
    4px 0 0 rgba(0,0,0,.44),
    15px 15px 0 rgba(0,0,0,.25);
  outline:1px solid rgba(255,255,255,.05);
}

/* ===== Left Panel ===== */
.panel-welcome{
  flex:1;
  padding:80px var(--pad-lg);
  color:var(--text-light);
}

/* ===== Left Panel Logo ===== */
.logo-container{
  max-width:340px;
  margin:38px 0 0 20px;
}

.logo-container img{
  width:100%;
  max-width:295px;
  height:auto;
  display:block;
  margin-left:18px;
  transform:scale(1.08);
  transform-origin:center;
}

.panel-welcome p{
  margin:0;
  margin-left:58px;
  margin-top:8px;
  font-size:13px;
  line-height:1.2;
  color:#f3f3f3;
  text-shadow:0 1px 6px rgba(0,0,0,.40);
}

/* ===== Right Panel ===== */
.panel-login{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:var(--pad-md) var(--pad-md) var(--pad-md) 60px;
  transform:scale(.85);
  transform-origin:center;
  margin-top:-5px;
  margin-left:-10px;
}

.welcome-container{
  width:100%;
  max-width:395px;
  height:auto;
  margin:0 auto 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:visible;
  text-align:center;
}

.welcome-container img{
  width:100%;
  max-width:390px;
  height:auto;
  display:block;
  transform:scale(1.18);
  transform-origin:center;
}

.panel-login h3{
  width:100%;
  max-width:300px;
  margin:-20px auto 14px auto;
  font-size:13px;
  font-weight:400;
  color:#ffffffcf;
  line-height:1.3;
  text-align:center;
  white-space:normal;
  overflow-wrap:break-word;
  word-break:normal;
}
.panel-login form{
  width:100%;
  max-width:300px;
  margin:0;
}

/* ===== Form ===== */
.form-group{
  width:100%;
  margin-bottom:var(--gap);
}

.form-group label{
  display:block;
  margin:0 0 5px;
  font-size:15px;
  font-weight:500;
  text-align:left;
  color:#ffffffa5;
}

.field{
  display:flex;
  align-items:center;
  padding:8px 12px;
  border-radius:6px;
  border:1px solid var(--input-border);
  transition:border-color .2s, box-shadow .2s;
}

.field:focus-within{
  border-color:var(--red);
  box-shadow:var(--focus-ring);
}

.field input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:#ffffff;
  font-size:14px;
  padding:2px 0;
}

.field-icon{
  width:20px;
  height:20px;
  margin-right:8px;
  flex-shrink:0;
}
.field-icon svg{
  width:20px;
  height:20px;
  color:#888888;
  transition:color .2s ease;
}
.field:focus-within .field-icon svg{
  color:var(--red);
}

.password-toggle{
  margin-left:8px;
  width:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:var(--input-border);
  opacity:.75;
  transition:opacity .2s, color .2s;
}
.password-toggle:hover{ opacity:1; }

/* ===== Remember + Forgot ===== */
.row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:13px;
  margin:5px 0 10px 5px;
}

.row label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  color:#ffffffad;
  font-weight:400;
}

.row input[type="checkbox"]{
  accent-color:var(--red);
  transform:scale(1.1);
  margin:0;
}

#register-form label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px; 
}

#register-form .form-row {
  display: grid;
  gap: 4px; 
}

#register-form .two-col {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#register-form input {
  margin: 0;
}

#register-form .row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
}

#register-form .row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 400;
  color: var(--text-dark);
}

/* checkbox */
#register-form input[type="checkbox"] {
  accent-color: var(--red);
  transform: scale(1.05);
  margin: 0;
}

/* terms link */
#tandc {
  color: var(--red);
  text-decoration: none;
  font-weight: 500;
}

#tandc:hover {
  text-decoration: underline;
}
.help-link{
  color:#ffffff;
  text-decoration:none;
  font-weight:500;
  border-bottom:1px solid #ffffff;
}
.help-link:hover{ opacity:.8; }

/* ===== Buttons ===== */
.btn-primary{
  width:100%;
  max-width:300px;
  display:block;
  margin:0 auto 15px;
  padding:10px 0;
  background:rgba(173,173,173,.45);
  color:#ffffff;
  border:2px solid rgba(255,255,255,.56);
  border-radius:13px;
  font-size:17px;
  font-weight:500;
  letter-spacing:.5px;
  cursor:pointer;
  transition:transform .2s ease, background .2s ease;
  
}

.btn-primary:hover{
  background:rgba(255,255,255,.15);
  transform:translateY(-2px);
}

.register-link{
  font-size:13px;
  margin-top:10px;
  text-align:center;
}
.register-link label{
  color:#ffffff9c;
  font-weight:500;
}
.register-link a{
  color:#ffffff;
  text-decoration:none;
  font-weight:500;
  border-bottom:1px solid #ffffff;
}
.register-link a:hover{ opacity:.8; }

/* ===== Error ===== */
.error-box{
  width:100%;
  max-width:300px;
  margin:0 auto 15px;
  padding:10px;
  border-radius:6px;
  background:var(--error-bg);
  color:var(--error-text);
  font-weight:500;
  font-size:13px;
  text-align:center;
  border:1px solid #fecaca;
}
.hidden {
  visibility: hidden;
}
/* ===== Modals ===== */
.modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:1000;
  justify-content:center;
  align-items:center;
  backdrop-filter:blur(4px);
  background:rgba(0,0,0,.35);
}

.modal-content{
  width:90%;
  max-width:500px;
  border-radius:30px;
  overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.40);
  background:rgba(255,255,255,.46);
}

.modal-header{
  background:linear-gradient(90deg, var(--dark-blue), var(--red));
  color:#ffffff;
  text-align:center;
  padding:20px 15px;
  position:relative;
}

.modal-header h2{
  margin:0;
  font-family:'Glacial Indifference',sans-serif;
  font-size:20px;
  font-weight:700;
}

.modal-header p{
  margin:6px 0 0;
  font-size:13px;
  font-weight:400;
  opacity:.9;
}

.role-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.role-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  color: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.role-btn[data-role="user"] {
  background:linear-gradient(135deg, #0c0c1bcb, #103074cb, #bc0404b4);
}

.role-btn[data-role="admin"] {
  background:linear-gradient(135deg, #0c0c1bcb, #103074cb, #bc0404b4);
}
/* Hover effect */
.role-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}
/* Active click */
.role-btn:active {
  transform: scale(0.98);
}

/* Modal forms */
#register-form,
#forgot-form{
  display:grid;
  grid-template-columns:1fr;
  gap:var(--gap);
  padding:var(--pad-sm);
  background:rgba(238,235,235,.35);
}

#register-form label,
#forgot-form label{
  font-size:14px;
  font-weight:600;
  color:var(--text-dark);
  margin-bottom: 2px;
}

#register-form input,
#forgot-form input{
  width:100%;
  padding:12px 15px;
  border-radius:10px;
  border:1px solid var(--input-border);
  background:#ffffff;
  color:var(--text-dark);
  font-size:14px;
  outline:none;
  transition: border-color .2s, box-shadow .2s;
}

#register-form input:focus,
#forgot-form input:focus{
  border-color:var(--red);
  box-shadow:var(--focus-ring);
}

#register-form button,
#forgot-form button{
  padding:12px;
  border-radius:12px;
  border:0;
  cursor:pointer;
  background:linear-gradient(135deg, #0c0c1b, #211f4d, #bc0404);
  color:#ffffff;
  font-weight:700;
  font-size:15px;
  transition:transform .2s, filter .2s;
}

#register-form button:hover,
#forgot-form button:hover{
  transform:translateY(-2px);
  filter:brightness(1.10);
}

/* Register layout helpers */
#register-form .form-row{ display:grid; gap:6px; }
#register-form .two-col{
  grid-template-columns:1fr 1fr;
  gap:12px;
}
#register-form .field-col{ display:grid; gap:6px; }

#register-form .relative{ position:relative; }
#register-form .relative .password-toggle{
  position:absolute;
  right:12px;
  top:34px;
  color:var(--text-dark);
  opacity:.6;
}
#register-form .relative .password-toggle:hover{
  color:var(--red);
  opacity:1;
}

/* Terms link */
#tandc{
  color:var(--red);
  text-decoration:none;
  font-weight:500;
}
#tandc:hover{ text-decoration:underline; }

/* Modal messages */
#register-message{
  font-size:13px;
  color:#1a7c17;
  text-align:center;
}
#forgot-message{
  font-size:13px;
  color:#333333;
  text-align:center;
}

/* ===== Responsive ===== */
@media (max-width:850px){
  .page{
    width:100%;
    height:auto;
    flex-direction:column;
    max-width:450px;
  }
  .panel-welcome{ display:none; }
  .panel-login{
    padding:30px;
    margin:0;
    transform:none;
  }
}

@media (max-width:520px){
  #register-form .two-col{ grid-template-columns:1fr; }
}

@media (max-width:480px){
  .modal-content{ border-radius:20px; }
  .modal-header h2{ font-size:18px; }
  #register-form button,
  #forgot-form button{ font-size:14px; }
}