/* =========================================================
   UG Exam System — Modern Login  |  style.css
   Brand palette pulled from exam.ug.edu.ge logo:
     Red:   #C8172B
     Navy:  #344265
     Grey:  #8A8D8F
   ========================================================= */

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

:root {
  /* ── Brand ── */
  --c-red:          #C8172B;
  --c-red-bright:   #E41F34;
  --c-red-dark:     #96101F;
  --c-navy:         #344265;
  --c-navy-deep:    #1E2A42;
  --c-navy-darker:  #111827;
  --c-grey:         #8A8D8F;
  --c-grey-light:   #B0B3B5;

  /* ── Surfaces ── */
  --c-bg:           #0E1525;
  --c-surface:      rgba(26, 36, 60, 0.78);
  --c-border:       rgba(52, 66, 101, 0.55);
  --c-border-focus: rgba(200, 23, 43, 0.6);
  --c-input-bg:     rgba(52, 66, 101, 0.25);

  /* ── Text ── */
  --c-text-hi:   #F1F4F9;
  --c-text-mid:  #94A3B8;
  --c-text-low:  #4A5C7A;

  /* ── Error ── */
  --c-error:     #F87171;

  /* ── Shape ── */
  --r-card:      24px;
  --r-input:     12px;
  --r-btn:       12px;
  --shadow-card: 0 32px 80px rgba(0,0,0,0.65), 0 0 0 1px rgba(52,66,101,0.4);

  /* ── Motion ── */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Base ── */
html { font-size: 16px; }

body {
  font-family: 'BPG Nino Mtavruli', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--c-bg);
  color: var(--c-text-hi);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background ── */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  animation: blobFloat 14s ease-in-out infinite alternate;
  will-change: transform;
}

/* Red blob — top-left */
.blob-1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, #C8172B, #96101F);
  top: -200px; left: -180px;
  animation-delay: 0s;
}

/* Navy blob — bottom-right */
.blob-2 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #344265, #1E2A42);
  bottom: -160px; right: -120px;
  opacity: 0.35;
  animation-delay: -5s;
}

/* Soft red glow — center right */
.blob-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #E41F34, #C8172B);
  top: 40%; right: 5%;
  opacity: 0.10;
  animation-delay: -9s;
}

@keyframes blobFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(25px, -25px) scale(1.04); }
  100% { transform: translate(-18px, 18px) scale(0.96); }
}

/* Dot-grid overlay */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
}

/* ── Language nav ── */
.lang-nav {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-text-mid);
  cursor: pointer;
  padding: 5px 11px;
  border-radius: 8px;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
}

.lang-btn:hover { color: var(--c-text-hi); background: rgba(52,66,101,0.35); }

.lang-btn.active {
  color: var(--c-red-bright);
  background: rgba(200,23,43,0.12);
}

.lang-sep { color: var(--c-text-low); font-size: 0.76rem; }

/* ── Login wrapper ── */
.login-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 460px;
  padding: 20px;
}

/* ── Card ── */
.login-card {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 48px 44px 38px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  animation: cardIn 0.65s var(--ease-out) both;
  overflow: hidden;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Top glow stripe */
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(200,23,43,0.75), transparent);
  border-radius: 50%;
}

/* Red left-side accent bar */
.login-card::after {
  content: '';
  position: absolute;
  top: 18%; bottom: 18%;
  left: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--c-red), transparent);
  border-radius: 0 2px 2px 0;
}

/* ── Card header ── */
.card-header {
  text-align: center;
  margin-bottom: 36px;
}

/* Logo — natural, no colour ring */
.logo-ring {
  width: 210px;
  height: 116px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* slight glow matching logo red */
  filter: drop-shadow(0 4px 18px rgba(200,23,43,0.35));
  transition: filter 0.3s;
}

.logo-img:hover {
  filter: drop-shadow(0 6px 28px rgba(228,31,52,0.55));
}

.logo-fallback {
  display: none;
  width: 72px; height: 72px;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--c-red), var(--c-red-dark));
  box-shadow: 0 4px 20px rgba(200,23,43,0.45);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-text-hi);
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 5px;
}

.brand-sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-red-bright);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Divider under header */
.card-header + .login-form {
  border-top: 1px solid rgba(52,66,101,0.4);
  padding-top: 28px;
}

/* ── Form ── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Field group ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--c-text-mid);
  text-transform: uppercase;
  transition: color 0.2s;
}

.field-group:focus-within .field-label { color: var(--c-red-bright); }

/* Input wrap */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--c-text-low);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.25s;
}

.field-group:focus-within .input-icon { color: var(--c-red); }

.field-input {
  width: 100%;
  background: var(--c-input-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  color: var(--c-text-hi);
  font-family: 'BPG Nino Mtavruli', 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  padding: 13px 14px 13px 44px;
  outline: none;
  caret-color: var(--c-red-bright);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.field-input::placeholder {
  color: var(--c-text-low);
  font-size: 0.88rem;
}

.field-input:focus {
  border-color: var(--c-red);
  background: rgba(200, 23, 43, 0.06);
  box-shadow: 0 0 0 3px rgba(200, 23, 43, 0.18);
}

.field-input.error {
  border-color: var(--c-error);
  box-shadow: 0 0 0 3px rgba(248,113,113,0.16);
}

/* Password toggle */
.toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-text-low);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s;
}

.toggle-pw:hover { color: var(--c-text-mid); }
.toggle-pw:focus-visible { outline: 2px solid var(--c-red); outline-offset: 2px; }

.input-line { display: none; }

/* ── Error text ── */
.field-error {
  font-size: 0.76rem;
  color: var(--c-error);
  font-weight: 500;
  min-height: 14px;
  display: block;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
}

.field-error.visible { opacity: 1; transform: translateY(0); }

/* ── No forgot-password section ── */
.form-extras { display: none; }

/* ── Submit button ── */
.submit-btn {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--r-btn);
  cursor: pointer;
  font-family: 'BPG Nino Mtavruli', 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, var(--c-red-bright) 0%, var(--c-red-dark) 100%);
  box-shadow: 0 4px 24px rgba(200, 23, 43, 0.5), inset 0 1px 0 rgba(255,255,255,0.12);
  overflow: hidden;
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s;
  margin-top: 4px;
}

.submit-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 38px rgba(228, 31, 52, 0.65), inset 0 1px 0 rgba(255,255,255,0.15);
}

.submit-btn:hover:not(:disabled)::after { opacity: 1; }

.submit-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 4px 16px rgba(200,23,43,0.4);
}

.submit-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.submit-btn:focus-visible { outline: 2px solid rgba(200,23,43,0.8); outline-offset: 3px; }

/* Ripple */
.submit-btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  transform: scale(0);
  animation: ripple 0.55s linear;
  pointer-events: none;
}

@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.btn-icon { display: flex; align-items: center; transition: transform 0.25s var(--ease-out); }
.submit-btn:hover .btn-icon { transform: translateX(4px); }

/* Spinner */
.btn-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.submit-btn.loading .btn-label,
.submit-btn.loading .btn-icon { display: none; }
.submit-btn.loading .btn-spinner { display: block; }

/* ── Card footer ── */
.card-footer {
  margin-top: 30px;
  text-align: center;
  padding-top: 18px;
  border-top: 1px solid rgba(52,66,101,0.3);
}

.footer-text {
  font-size: 0.73rem;
  color: var(--c-text-low);
  line-height: 1.5;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(14, 21, 37, 0.96);
  border: 1px solid rgba(52,66,101,0.5);
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-text-hi);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s var(--ease-out);
  pointer-events: none;
  white-space: nowrap;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error   { border-color: rgba(200,23,43,0.5); }
.toast.success { border-color: rgba(52,211,153,0.4); }

/* ── Responsive ── */
@media (max-width: 500px) {
  .login-card { padding: 36px 24px 28px; border-radius: 20px; }
  .logo-ring  { width: 170px; height: 94px; }
  .brand-title { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
