/* admin.css - centered large logo, modern login card, responsive, animated */

/* ================= ROOT VARIABLES ================= */
:root{
  --bg: #eef6f2;
  --card: #ffffff;
  --accent: #2fa66a;      /* primary green */
  --accent-2: #1f8f56;    /* darker green */
  --muted: #6b6b6b;
  --success: #2ea44f;
  --danger: #e55353;
  --glass: rgba(255,255,255,0.95);
  --shadow: 0 18px 40px rgba(20,20,40,0.06);
  --radius: 16px;
  --max-width: 520px;
  font-family: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* ================= RESET ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; }

/* ================= PAGE BACKGROUND ================= */
body {
  background: linear-gradient(180deg, #f7fbf9, var(--bg));
  color: #111;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

/* ================= CARD WRAPPER ================= */
.login-card-wrap {
  width: 100%;
  max-width: var(--max-width);
  perspective: 1200px;
}

/* ================= CARD ================= */
.login-card {
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), var(--card));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
  border: 1px solid rgba(0,0,0,0.04);
  transform-origin: center;
  transform: translateY(18px) rotateX(6deg);
  opacity: 0;
  transition: transform .6s cubic-bezier(.2,.9,.2,1), opacity .6s ease;
  position: relative;
  overflow: visible;
}

/* entrance state toggled by JS */
.login-card.enter {
  transform: translateY(0) rotateX(0);
  opacity: 1;
}

/* ================= BRAND (LOGO CENTERED) ================= */
.brand {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  margin-bottom: 18px;
}

/* Large centered logo */
.brand-logo {
  width: 200px;            /* large on desktop */
  height: 200px;
  object-fit: contain;
  
  padding: 12px;
  transform-origin: center;
  transition: transform .45s cubic-bezier(.2,.9,.2,1), box-shadow .3s ease;
}

/* Slight hover lift for logo */
.brand-logo:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 16px 40px rgba(47,166,106,0.12); }

/* Brand text follows logo */
.brand-text h1 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--accent-2);
  letter-spacing: -0.02em;
  font-weight: 700;
  text-align: center;
}
.brand-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ================= ALERTS ================= */
.alert {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
}
.alert.success {
  background: rgba(46,164,79,0.12);
  color: var(--success);
  border: 1px solid rgba(46,164,79,0.14);
}
.alert.error {
  background: rgba(229,83,83,0.08);
  color: var(--danger);
  border: 1px solid rgba(229,83,83,0.12);
}

/* ================= FORM LAYOUT ================= */
.login-form {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  text-align: left;
  width: 100%;
}

/* Field label */
.field { display:block; }
.label-text {
  display:block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}

/* Input wrapper with left icon space */
.input-wrap {
  position: relative;
}
.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 48px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(250,252,251,0.98);
  font-size: 1rem;
  transition: box-shadow .18s ease, border-color .18s ease, transform .12s ease;
}
.input-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  opacity: 0.95;
}

/* Focus state */
.input-wrap input:focus {
  outline: none;
  border-color: rgba(47,166,106,0.9);
  box-shadow: 0 10px 30px rgba(47,166,106,0.08);
  transform: translateY(-2px);
}

/* ================= ACTIONS ================= */
.actions {
  text-align: center;
  margin-top: 5px;
}
a.btn {
  display: inline-block;
  text-decoration: none;
}


.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px rgba(31,143,86,0.12);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(31,143,86,0.14); }

/* ================= SUCCESS OVERLAY ================= */
.success-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(.9);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2,.9,.2,1);
}
.login-card.successing .success-overlay {
  opacity: 1;
  transform: scale(1);
}
.success-overlay .check {
  width: 96px;
  height: 96px;
}
.check-circle {
  stroke: rgba(47,166,106,0.12);
  stroke-width: 4;
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: circle-draw .6s ease forwards;
}
.check-mark {
  stroke: #2fa66a;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: mark-draw .45s .25s ease forwards;
}
@keyframes circle-draw { to { stroke-dashoffset: 0; } }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }

/* ================= SHAKE FOR INVALID ================= */
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.login-card.shake { animation: shake .6s cubic-bezier(.36,.07,.19,.97); }

/* ================= TOAST ================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  display: none;
  z-index: 9999;
  font-weight: 600;
}

/* ================= RESPONSIVE ADJUSTMENTS ================= */
/* Medium screens */
@media (max-width: 900px) {
  :root { --max-width: 460px; }
  .brand-logo { width: 120px; height: 120px; }
  .login-card { padding: 24px; }
}

/* Small screens */
@media (max-width: 480px) {
  :root { --max-width: 380px; }
  .login-card { padding: 18px; border-radius: 12px; }
  .brand-logo { width: 96px; height: 96px; }
  .brand-text h1 { font-size: 1.05rem; }
  .brand-sub { font-size: 0.85rem; }
  .input-wrap input { padding-left: 44px; }
  .actions { flex-direction: column; gap: 10px; align-items: stretch; }
  .btn { width: 100%; }
}

/* Extra small screens */
@media (max-width: 360px) {
  .brand-logo { width: 84px; height: 84px; padding: 8px; }
  .input-wrap input { padding-left: 40px; }
}

/* ================= ACCESSIBILITY ================= */
/* Focus visible outline for keyboard users */
input:focus-visible { outline: 3px solid rgba(47,166,106,0.12); outline-offset: 2px; }

/* ================= UTILITY ================= */
.hidden { display: none !important; }
