/* ==========================================================================
   PhynixWeb One — Modern Authentication Design System
   Matches Client Portal & Admin Console Aesthetics
   ========================================================================== */

:root, [data-theme="dark"] {
  --brand-primary: #0052FF;
  --brand-accent: #FF5722;
  --bg: #0b0f19;
  --surface: #121826;
  --surface-soft: #1a2234;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --input-bg: #1a2234;
  --input-border: rgba(255, 255, 255, 0.12);
  --input-color: #ffffff;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --toggle-bg: rgba(255, 255, 255, 0.08);
  --toggle-border: rgba(255, 255, 255, 0.15);
  --toggle-color: #f1f5f9;
}

[data-theme="light"] {
  --brand-primary: #0052FF;
  --brand-accent: #FF5722;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-color: #0f172a;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
  --toggle-bg: #ffffff;
  --toggle-border: #cbd5e1;
  --toggle-color: #0f172a;
}

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

body.login-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  transition: background 0.2s ease, color 0.2s ease;
}

.auth-container,
.login-card-container {
  width: 100%;
  max-width: 440px;
}

.auth-card,
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-header a {
  display: inline-block;
  text-decoration: none;
}

.brand-header img,
.login-logo {
  height: 48px;
  max-height: 52px;
  max-width: 250px;
  width: auto;
  object-fit: contain;
  margin-bottom: 16px;
  display: inline-block;
}

.brand-header h1,
.login-card h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  text-align: center;
}

.brand-header p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
}

.form-grid,
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

label {
  display: block;
}

label span,
.label-text {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]) {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--input-color);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.14);
}

.alert,
.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 20px;
}

.notice {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #0284c7;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
}

.btn-submit,
.primary-button.full {
  background: linear-gradient(135deg, var(--brand-primary, #0052FF) 0%, #1e40af 100%);
  color: #ffffff !important;
  border: none;
  border-radius: 8px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
  box-shadow: 0 4px 14px rgba(0, 82, 255, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-submit:hover,
.primary-button.full:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 82, 255, 0.45);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.auth-footer a,
.portal-link {
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-footer a:hover,
.portal-link:hover {
  text-decoration: underline;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  color: var(--toggle-color);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.theme-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.back-to-website-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.back-to-website-btn:hover {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text);
  transform: translateY(-1px);
}

.password-field-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.password-field-wrapper input {
  padding-right: 42px !important;
  width: 100%;
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #94a3b8);
  line-height: 1;
  z-index: 3;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--brand-primary, #0052FF);
}

@media (max-width: 480px) {
  .auth-card,
  .login-card {
    padding: 28px 20px;
  }
}
