*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f0;
  font-family: 'Segoe UI', sans-serif;
  padding: 20px 20px 76px;
}

.login-shell {
  width: 780px;
  max-width: 100%;
}

.login-card {
  display: flex;
  width: 100%;
  max-width: 100%;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
  background: #fff;
}

/* ========== LEFT SIDEBAR ========== */
.login-left {
  width: 260px;
  min-width: 260px;
  background: linear-gradient(160deg, #0f4a31 0%, #1a6b4a 55%, #1d8257 100%);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -70px; left: -70px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -50px; right: -50px;
  width: 170px; height: 170px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.school-logo-img {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 22px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.18));
}

.school-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.school-sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 36px;
  line-height: 1.4;
}

.role-section-label {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

.role-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 6px;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  transition: all 0.18s ease;
  position: relative;
  z-index: 1;
}
.role-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.role-btn.active {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.role-btn.active .role-icon {
  background: #f0c94a;
  color: #0f4a31;
}
.role-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.role-icon i { font-size: 17px; }
.role-text-main { font-size: 13px; font-weight: 600; line-height: 1.2; }
.role-text-sub { font-size: 10.5px; color: rgba(255,255,255,0.38); margin-top: 2px; }
.role-btn.active .role-text-sub { color: rgba(255,255,255,0.6); }

.login-footer {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: min(780px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(160deg, #0f4a31 0%, #1a6b4a 55%, #1d8257 100%);
  color: #fff;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 12px 28px rgba(15, 74, 49, 0.18);
  z-index: 10;
}

/* ========== RIGHT FORM ========== */
.login-right {
  flex: 1;
  background: #fff;
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
}

.right-header { margin-bottom: 28px; }
.right-title {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin-bottom: 5px;
  letter-spacing: -0.4px;
}
.right-sub {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
}

/* Panels */
.panel { display: none; }
.panel.active { display: block; }

/* Form elements */
.field-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.field-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e5e2;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: #111;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 15px;
  font-family: inherit;
}
.field-input:focus {
  border-color: #2d9c6f;
  box-shadow: 0 0 0 3px rgba(45,156,111,0.1);
}
.field-input::placeholder { color: #bbb; }

select.field-input {
  appearance: none;
  -webkit-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='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
  color: #333;
}
select.field-input option[value=""] { color: #bbb; }

/* Phone row */
.phone-row {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}
.phone-prefix {
  flex-shrink: 0;
  width: 72px;
  padding: 10px 10px;
  border: 1px solid #e2e5e2;
  border-radius: 10px;
  font-size: 14px;
  background: #f7f8f7;
  color: #444;
  text-align: center;
  font-family: inherit;
  font-weight: 500;
}
.phone-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e2e5e2;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: #111;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.phone-input:focus {
  border-color: #2d9c6f;
  box-shadow: 0 0 0 3px rgba(45,156,111,0.1);
}
.phone-input::placeholder { color: #bbb; }

/* OTP method selector */
.otp-method-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 7px;
  font-weight: 500;
}
.otp-methods {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.otp-method-btn {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #e2e5e2;
  border-radius: 9px;
  background: #f7f8f7;
  color: #777;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
  font-family: inherit;
  font-weight: 500;
}
.otp-method-btn:hover { border-color: #2d9c6f; color: #1a6b4a; background: #f0f9f5; }
.otp-method-btn.selected {
  border-color: #2d9c6f;
  background: #e8f5ee;
  color: #0f4a31;
}
.otp-method-btn i { font-size: 16px; }

/* Send OTP button */
.send-otp-btn {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e5e2;
  border-radius: 10px;
  background: #f7f8f7;
  color: #555;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 14px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
}
.send-otp-btn:hover { border-color: #2d9c6f; color: #1a6b4a; background: #f0f9f5; }
.send-otp-btn.sent {
  background: #e8f5ee;
  border-color: #2d9c6f;
  color: #0f4a31;
}

/* OTP boxes */
.otp-section { display: none; margin-bottom: 14px; }
.otp-section.visible { display: block; }
.otp-note {
  font-size: 12px;
  color: #777;
  margin-bottom: 10px;
}
.otp-boxes {
  display: flex;
  gap: 8px;
}
.otp-box {
  width: 46px; height: 50px;
  border: 1px solid #e2e5e2;
  border-radius: 10px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  background: #fff;
  color: #111;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.otp-box:focus {
  border-color: #2d9c6f;
  box-shadow: 0 0 0 3px rgba(45,156,111,0.1);
}

/* Password field */
.pwd-wrap {
  position: relative;
  margin-bottom: 8px;
}
.pwd-wrap .field-input { margin-bottom: 0; padding-right: 44px; }
.pwd-toggle {
  position: absolute;
  right: 13px; top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #aaa;
  font-size: 18px;
  line-height: 1;
  user-select: none;
  transition: color 0.15s;
}
.pwd-toggle:hover { color: #555; }

/* Forgot link */
.forgot-row {
  text-align: right;
  margin-bottom: 18px;
  margin-top: 4px;
}
.forgot-link {
  font-size: 12px;
  color: #2d9c6f;
  text-decoration: none;
  font-weight: 500;
}
.forgot-link:hover { text-decoration: underline; }

/* Status messages */
.status-msg {
  font-size: 12.5px;
  padding: 9px 13px;
  border-radius: 9px;
  margin-bottom: 12px;
  font-weight: 500;
  align-items: center;
  gap: 6px;
}
.status-msg.success { background: #e8f5ee; color: #0f4a31; border: 1px solid #d1e9db; }
.status-msg.error { background: #fce8e8; color: #a32d2d; border: 1px solid #f6cfcf; }
.invalid-feedback {
  display: block;
  font-size: 11px;
  color: #a32d2d;
  margin-top: 4px;
}

/* Info badge */
.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e8f5ee;
  color: #0f4a31;
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 11.5px;
  margin-bottom: 18px;
  font-weight: 500;
}
.info-badge i { font-size: 14px; }

/* Main submit button */
.submit-btn {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1a6b4a 0%, #2d9c6f 100%);
  color: #fff;
  border: none;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
}
.submit-btn:hover { opacity: 0.92; }
.submit-btn:active { transform: scale(0.99); }
.submit-btn i { font-size: 18px; }

/* Footer note */
.form-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 11.5px;
  color: #aaa;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 620px) {
  body { padding: 10px; }
  .login-card { flex-direction: column; width: 100%; border-radius: 16px; }
  .login-left {
    width: 100%;
    min-width: unset;
    padding: 24px 20px 20px;
  }
  .school-sub { margin-bottom: 18px; }
  .roles-row {
    display: flex;
    gap: 6px;
  }
  .role-btn { flex: 1; flex-direction: column; padding: 10px 6px; text-align: center; }
  .role-text-sub { display: none; }
  .role-btn { margin-bottom: 0; }
  .login-right { padding: 28px 22px 30px; }
  .otp-box { width: 38px; height: 44px; font-size: 18px; }
  .left-bottom { display: none; }
}
