/* ==========================================================================
   Modern Responsive Stylesheet & Accessible UI Theme
   Project: Login Page Project (Frontend Validation Prototype)
   ========================================================================== */

:root {
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #0f172a;
  --border-card: #334155;
  --border-input: #475569;
  --border-focus: #6366f1;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --error-bg: rgba(239, 68, 68, 0.15);
  --error-border: #ef4444;
  --error-text: #fca5a5;
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-border: #10b981;
  --success-text: #6ee7b7;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --radius: 12px;
  --transition: all 0.2s ease-in-out;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.5;
}

.page-wrapper {
  width: 100%;
  max-width: 440px;
  display: flex;
  justify-content: center;
}

/* Card Container */
.login-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

/* Header */
.card-header {
  text-align: center;
  margin-bottom: 24px;
}

.lock-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.card-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.card-header .subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Accessible Alert Message Box */
.message-box {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 18px;
  text-align: left;
  animation: fadeIn 0.25s ease-out;
}

.message-box.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

.message-box.success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 18px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.label-row label {
  margin-bottom: 0;
}

.toggle-btn {
  background: none;
  border: none;
  color: #818cf8;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0 4px;
  font-weight: 500;
}

.toggle-btn:hover {
  text-decoration: underline;
  color: #a5b4fc;
}

input {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.95rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-main);
  transition: var(--transition);
}

input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

input::placeholder {
  color: #64748b;
  font-size: 0.9rem;
}

/* Primary Button */
.btn-primary {
  width: 100%;
  padding: 12px;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 3px solid #818cf8;
  outline-offset: 2px;
}

/* Demo Credentials Box */
.demo-box {
  margin-top: 26px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed var(--border-card);
  border-radius: 8px;
  text-align: center;
}

.demo-title {
  font-size: 0.85rem;
  color: #e2e8f0;
}

.demo-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 10px;
}

.demo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}

.demo-chip {
  background: #334155;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.demo-chip:hover {
  background: #475569;
  color: #f8fafc;
  border-color: #64748b;
}

.security-disclaimer {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.4;
  border-top: 1px solid #334155;
  padding-top: 10px;
}

/* Welcome Page Specific Styles */
.welcome-card {
  max-width: 600px;
  text-align: left;
}

.welcome-header {
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.welcome-header h1 {
  font-size: 1.7rem;
  color: var(--text-main);
}

.badge-auth {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid #059669;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
}

.welcome-body p {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: 16px;
  line-height: 1.6;
}

.info-panel {
  background: rgba(15, 23, 42, 0.7);
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
}

.info-panel h3 {
  font-size: 0.95rem;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.info-panel p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0;
}

.btn-secondary {
  display: inline-block;
  padding: 10px 18px;
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
}

.btn-secondary:hover {
  background: #475569;
  color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  body {
    padding: 12px;
  }
  .login-card {
    padding: 24px 18px;
  }
  .card-header h1 {
    font-size: 1.4rem;
  }
}
