* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  background: #050505;
  color: #F8F6F2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

input, button, textarea { font-family: inherit; }

.view { display: none; min-height: 100vh; position: relative; }
.view.active { display: block; }
.view[hidden] { display: none !important; }

.bg-glow-top {
  position: fixed; top: -30%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse, rgba(201,169,97,0.12) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
.bg-glow-bottom-left {
  position: fixed; bottom: -20%; left: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(232,212,158,0.05) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
.bg-glow-bottom-right {
  position: fixed; bottom: -10%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(201,169,97,0.06) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
.top-line {
  position: fixed; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,97,0.4), transparent);
  z-index: 1;
}

.login-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; z-index: 2;
}
.login-card {
  width: 100%; max-width: 420px; padding: 48px 44px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(201,169,97,0.15);
  border-radius: 18px;
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}
.login-header {
  display: flex; flex-direction: column; align-items: center; margin-bottom: 36px;
}

.brand-name {
  font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
  font-size: 36px;
  font-weight: 500;
  color: #E8D49E;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
  margin-top: 8px;
  text-align: center;
  background: linear-gradient(135deg, #E8D49E 0%, #C9A961 50%, #8A7340 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(201,169,97,0.15);
}
.brand-tagline {
  font-size: 11px; color: rgba(201,169,97,0.7);
  letter-spacing: 0.2em; font-weight: 500;
}

.form-group { margin-bottom: 18px; }

.fld-label {
  display: block; font-size: 10.5px; color: rgba(201,169,97,0.7);
  letter-spacing: 0.18em; font-weight: 500; margin-bottom: 8px;
}
.fld {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 11px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(201,169,97,0.15);
  transition: all 0.2s;
}
.fld:focus-within {
  border-color: rgba(201,169,97,0.5);
  background: rgba(0,0,0,0.4);
  box-shadow: 0 0 0 3px rgba(201,169,97,0.08);
}
.fld-icon { color: rgba(201,169,97,0.6); font-size: 16px; flex-shrink: 0; }
.fld-input {
  border: none; outline: none; background: transparent;
  flex: 1; font-size: 13.5px; color: #F8F6F2; min-width: 0;
}
.fld-input::placeholder {
  color: rgba(248,246,242,0.3); letter-spacing: 0.05em;
}
.fld-icon-toggle {
  color: rgba(201,169,97,0.5); font-size: 16px;
  cursor: pointer; padding: 0 4px; flex-shrink: 0;
  transition: color 0.15s;
}
.fld-icon-toggle:hover { color: rgba(232,212,158,0.85); }

.form-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 24px; font-size: 12px; flex-wrap: wrap; gap: 10px;
}

.remember {
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; user-select: none;
}
.remember input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(201,169,97,0.45);
  background: rgba(0,0,0,0.4);
  cursor: pointer; position: relative;
  flex-shrink: 0; transition: all 0.15s; margin: 0;
}
.remember input[type="checkbox"]:hover {
  border-color: rgba(201,169,97,0.7);
  background: rgba(201,169,97,0.06);
}
.remember input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #C9A961 0%, #8A7340 100%);
  border-color: rgba(201,169,97,0.8);
}
.remember input[type="checkbox"]:checked::after {
  content: ""; position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #050505; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.remember-label {
  color: rgba(201,169,97,0.85); letter-spacing: 0.02em;
  transition: color 0.15s;
}
.remember:hover .remember-label { color: #E8D49E; }

.forgot-link {
  color: rgba(201,169,97,0.85); text-decoration: none;
  letter-spacing: 0.02em; transition: color 0.15s;
}
.forgot-link:hover { color: #E8D49E; }

.error-box {
  display: none;
  background: rgba(200,80,80,0.08);
  border: 1px solid rgba(200,80,80,0.25);
  color: #E8A5A5;
  padding: 10px 14px; border-radius: 10px;
  font-size: 12.5px; margin-bottom: 14px;
  align-items: center; gap: 8px;
}
.error-box.visible {
  display: flex;
}
.error-box i { font-size: 16px; flex-shrink: 0; }

.btn-login {
  width: 100%; padding: 14px; border-radius: 11px;
  background: linear-gradient(135deg, #C9A961 0%, #8A7340 100%);
  border: none; color: #050505;
  font-weight: 600; font-size: 13px;
  cursor: pointer; letter-spacing: 0.2em;
  box-shadow: 0 8px 24px rgba(201,169,97,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-login:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(201,169,97,0.32), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-login:active:not(:disabled) { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-login.loading .btn-label::before {
  content: ""; display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(5,5,5,0.3);
  border-top-color: #050505;
  border-radius: 50%;
  margin-right: 10px; vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lang-row {
  margin-top: 24px; padding-top: 22px;
  border-top: 1px solid rgba(201,169,97,0.1);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.lang-btn {
  padding: 6px 12px; border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(248,246,242,0.5);
  font-size: 10.5px; font-weight: 500;
  cursor: pointer; letter-spacing: 0.1em;
  transition: all 0.15s;
}
.lang-btn:hover {
  color: rgba(248,246,242,0.8);
  background: rgba(201,169,97,0.05);
}
.lang-active {
  background: rgba(201,169,97,0.12);
  color: #E8D49E;
  border-color: rgba(201,169,97,0.25);
}

.footer-stamp {
  position: fixed; bottom: 24px; left: 0; right: 0;
  text-align: center; z-index: 1;
  font-size: 10.5px; color: rgba(201,169,97,0.4);
  letter-spacing: 0.25em;
}

.app-shell {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 24px; position: relative; z-index: 2;
}
.app-placeholder {
  text-align: center; max-width: 480px;
  padding: 48px 36px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(201,169,97,0.15);
  border-radius: 18px;
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.ap-title {
  font-size: 22px; font-weight: 400; color: #F8F6F2;
  letter-spacing: 0.28em; margin-bottom: 6px;
}
.ap-name {
  font-size: 16px; color: #E8D49E;
  margin-bottom: 4px; letter-spacing: 0.02em;
}
.ap-meta {
  font-size: 11.5px; color: rgba(248,246,242,0.5);
  letter-spacing: 0.12em; margin-bottom: 32px;
}
.btn-secondary {
  padding: 11px 20px; border-radius: 10px;
  background: rgba(201,169,97,0.08);
  border: 1px solid rgba(201,169,97,0.25);
  color: #E8D49E; font-size: 12px;
  font-weight: 500; letter-spacing: 0.18em;
  cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-secondary:hover {
  background: rgba(201,169,97,0.14);
  border-color: rgba(201,169,97,0.4);
}
.ap-hint {
  margin-top: 28px; font-size: 11px;
  color: rgba(248,246,242,0.35);
  letter-spacing: 0.05em; font-style: italic;
}

.ap-brand {
  font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
  font-size: 30px;
  font-weight: 500;
  color: #E8D49E;
  letter-spacing: 0.14em;
  margin-bottom: 20px;
  text-align: center;
  background: linear-gradient(135deg, #E8D49E 0%, #C9A961 50%, #8A7340 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


.fld.invalid {
  border-color: rgba(212,131,131,0.55);
  background: rgba(212,131,131,0.04);
  box-shadow: 0 0 0 3px rgba(212,131,131,0.08);
  animation: shake 0.35s ease-in-out;
}
.fld.invalid .fld-icon {
  color: #D48383;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@media (max-width: 480px) {
  .login-card { padding: 36px 28px; }
  .footer-stamp { font-size: 9.5px; bottom: 16px; }
}
