/* ============================================================
   LOGIN V2 — KW Birlik Cockpit
   Liquid Glass · Aurora ısı halesi · 3D parallax · Spring physics
   ============================================================ */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(20px, 5vh, 56px) 24px clamp(20px, 5vh, 56px);
  background:
    radial-gradient(ellipse 70% 60% at 50% 30%, #FFF6F2 0%, #FAF7F4 35%, #F5F5F7 70%, #EFEEF1 100%);
  overflow-y: auto;
  overflow-x: hidden;
  animation: login-screen-in 600ms cubic-bezier(0.32, 0.72, 0, 1);
}
.login-screen::after {
  /* Spacer top — hafif aşağı iter, kart vertical-balanced görünür */
  content: '';
  flex: 0 0 max(0px, calc((100vh - 720px) * 0.5));
  order: -1;
}
[data-theme="dark"] .login-screen {
  background:
    radial-gradient(ellipse 70% 60% at 50% 30%, #1F1416 0%, #18141A 35%, #0F1014 70%, #0A0B0F 100%);
}

@keyframes login-screen-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Aurora — multi-radial KW kırmızı ısı halesi ──────────── */
.login-aurora {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 50% 40% at 30% 20%, rgba(200, 16, 46, 0.10), transparent 55%),
    radial-gradient(ellipse 60% 50% at 75% 75%, rgba(255, 77, 109, 0.08), transparent 60%),
    radial-gradient(ellipse 40% 35% at 85% 15%, rgba(255, 154, 158, 0.06), transparent 60%),
    radial-gradient(ellipse 45% 40% at 15% 85%, rgba(230, 57, 70, 0.05), transparent 60%);
  filter: blur(40px);
  opacity: 0.95;
  animation: aurora-drift-login 28s ease-in-out infinite alternate;
}
[data-theme="dark"] .login-aurora {
  background:
    radial-gradient(ellipse 50% 40% at 30% 20%, rgba(255, 59, 92, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 75% 75%, rgba(255, 77, 109, 0.14), transparent 60%),
    radial-gradient(ellipse 40% 35% at 85% 15%, rgba(220, 60, 90, 0.10), transparent 60%),
    radial-gradient(ellipse 45% 40% at 15% 85%, rgba(150, 40, 70, 0.08), transparent 60%);
  opacity: 0.85;
}
@keyframes aurora-drift-login {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -20px) scale(1.04); }
  100% { transform: translate(-20px, 25px) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .login-aurora { animation: none; }
}

/* ─── Film grain texture ─────────────────────────────────── */
.login-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}
[data-theme="dark"] .login-grain { opacity: 0.045; }

/* ─── Card ────────────────────────────────────────────────── */
.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 44px 40px 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 32px 80px -24px rgba(40, 16, 24, 0.18),
    0 12px 32px -12px rgba(200, 16, 46, 0.10),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04);
  transform-style: preserve-3d;
  transform: perspective(1200px) rotateX(0deg) rotateY(0deg) translateZ(0);
  transition: transform 240ms cubic-bezier(0.32, 0.72, 0, 1), opacity 320ms cubic-bezier(0.32, 0.72, 0, 1);
  animation: login-card-in 540ms cubic-bezier(0.32, 0.72, 0, 1) 80ms both;
  display: flex;
  flex-direction: column;
}
.login-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  pointer-events: none;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.45), transparent 35%),
    radial-gradient(circle at 100% 100%, rgba(255, 230, 235, 0.18), transparent 40%);
  opacity: 0.7;
}
[data-theme="dark"] .login-card {
  background: rgba(28, 28, 30, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 32px 80px -24px rgba(0, 0, 0, 0.55),
    0 12px 32px -12px rgba(255, 59, 92, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .login-card::after {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.06), transparent 35%),
    radial-gradient(circle at 100% 100%, rgba(255, 59, 92, 0.05), transparent 40%);
}

@keyframes login-card-in {
  from { opacity: 0; transform: perspective(1200px) translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: perspective(1200px) translateY(0) scale(1); }
}

.login-card.fade-out {
  opacity: 0;
  transform: perspective(1200px) scale(1.03) translateZ(0) !important;
  filter: blur(2px);
}

/* ─── Brand row ──────────────────────────────────────────── */
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.login-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #C8102E 0%, #FF4D6D 60%, #FF8FA3 100%);
  color: white;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 8px 20px -4px rgba(200, 16, 46, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}
.login-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.4), transparent 55%);
  pointer-events: none;
}
.login-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.login-brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.2;
}
.login-brand-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  line-height: 1.2;
}

.login-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.08), transparent);
  margin: 0 0 24px;
}
[data-theme="dark"] .login-divider {
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.10), transparent);
}

/* ─── H1 + sub ───────────────────────────────────────────── */
.login-h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-primary);
  margin: 0 0 10px;
}
.login-sub {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
  margin: 0 0 26px;
  max-width: 320px;
}

/* ─── Form fields ────────────────────────────────────────── */
.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.login-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding-left: 2px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.login-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 220ms cubic-bezier(0.32, 0.72, 0, 1);
}
.login-input-wrap input {
  width: 100%;
  padding: 14px 16px 14px 42px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  font-family: inherit;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  outline: none;
  transition: all 220ms cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.login-input-wrap input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
  letter-spacing: 0;
}
.login-input-wrap input:hover:not(:focus):not(:disabled) {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(0, 0, 0, 0.10);
}
.login-input-wrap input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--kw-red);
  box-shadow:
    0 0 0 4px rgba(200, 16, 46, 0.10),
    0 4px 12px -2px rgba(200, 16, 46, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}
.login-input-wrap:focus-within .login-input-icon { color: var(--kw-red); }
.login-input-wrap input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

[data-theme="dark"] .login-input-wrap input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .login-input-wrap input:hover:not(:focus):not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .login-input-wrap input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--kw-red);
  box-shadow:
    0 0 0 4px rgba(255, 59, 92, 0.14),
    0 4px 12px -2px rgba(255, 59, 92, 0.22);
}

/* Native autofill override */
.login-input-wrap input:-webkit-autofill,
.login-input-wrap input:-webkit-autofill:hover,
.login-input-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 100px rgba(255, 255, 255, 0.95) inset, 0 0 0 4px rgba(200, 16, 46, 0.10);
  caret-color: var(--text-primary);
  transition: background-color 5000s ease-in-out 0s;
}
[data-theme="dark"] .login-input-wrap input:-webkit-autofill,
[data-theme="dark"] .login-input-wrap input:-webkit-autofill:hover,
[data-theme="dark"] .login-input-wrap input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px rgba(40, 40, 42, 0.95) inset, 0 0 0 4px rgba(255, 59, 92, 0.14);
}

/* Eye toggle */
.login-input-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms;
}
.login-input-eye:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .login-input-eye:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ─── Error ──────────────────────────────────────────────── */
.login-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  margin: 4px 0 16px;
  background: linear-gradient(180deg, rgba(200, 16, 46, 0.07), rgba(200, 16, 46, 0.025));
  border-left: 3px solid var(--kw-red);
  border-radius: 0 12px 12px 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--kw-red);
  animation: login-err-shake 380ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
.login-error span:first-child {
  font-size: 14px;
  line-height: 1.3;
  flex-shrink: 0;
}
@keyframes login-err-shake {
  0%, 100% { transform: translateX(0); }
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
[data-theme="dark"] .login-error {
  background: linear-gradient(180deg, rgba(255, 59, 92, 0.10), rgba(255, 59, 92, 0.04));
}

/* ─── Submit button ──────────────────────────────────────── */
.login-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--kw-red) 0%, #FF4D6D 100%);
  color: white;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  font-family: inherit;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 6px 18px -4px rgba(200, 16, 46, 0.50),
    0 1px 2px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    inset 0 -1px 0 rgba(0, 0, 0, 0.10);
  transition: all 220ms cubic-bezier(0.32, 0.72, 0, 1);
}
.login-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0;
  transition: opacity 220ms;
  pointer-events: none;
}
.login-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 14px 28px -8px rgba(200, 16, 46, 0.58),
    0 2px 4px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.login-submit:hover:not(:disabled)::before { opacity: 1; }
.login-submit:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
  transition-duration: 100ms;
}
.login-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.login-submit svg { transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1); }
.login-submit:hover:not(:disabled) svg { transform: translateX(3px); }

/* Loading spinner */
.login-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  animation: login-spin 700ms linear infinite;
  margin-left: 4px;
}
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-submit.loading {
  cursor: progress;
  opacity: 0.92;
}

.login-submit.success {
  background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
  box-shadow:
    0 14px 28px -8px rgba(52, 199, 89, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ─── Footer ─────────────────────────────────────────────── */
.login-footer-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.08), transparent);
  margin: 22px 0 16px;
}
[data-theme="dark"] .login-footer-divider {
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.login-footer {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-footer li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.003em;
  color: var(--text-tertiary);
}
.login-footer li b {
  font-weight: 600;
  color: var(--text-secondary);
}
.login-footer-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(200, 16, 46, 0.07);
  color: var(--kw-red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .login-footer-icon {
  background: rgba(255, 59, 92, 0.12);
}

/* ─── Meta line ──────────────────────────────────────────── */
.login-meta {
  position: relative;
  z-index: 10;
  margin-top: 24px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: -0.003em;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: login-meta-in 600ms cubic-bezier(0.32, 0.72, 0, 1) 240ms both;
}
.login-meta a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: all 150ms;
}
.login-meta a:hover {
  color: var(--kw-red);
  border-bottom-color: var(--kw-red);
}
.login-meta-sep { opacity: 0.5; }
@keyframes login-meta-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Success state — screen fade ─────────────────────────── */
.login-screen.is-success {
  animation: login-screen-out 720ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
@keyframes login-screen-out {
  to { opacity: 0; }
}

/* ─── Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card { padding: 36px 28px 24px; }
  .login-h1 { font-size: 28px; }
}
