/* ====================================================================
   KARUNADA NEWS (ಕರುನಾಡ ನ್ಯೂಸ್) - HIGHLY ANIMATED NEWSPAPER SIGN IN
   Modern Editorial UI/UX with 3D Tilt, Floating Particles & Full Mobile Support
   ==================================================================== */

:root {
  /* Fonts */
  --font-serif: 'Newsreader', Georgia, serif;
  --font-display: 'Cinzel', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-kn: 'Anek Kannada', sans-serif;

  /* Animation curves */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-editorial: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ====================================================================
   THEME 1: AUTHENTIC WARM NEWSPRINT (Default)
   ==================================================================== */
[data-theme="paper"] {
  --bg-body: #e4ddd0;
  --bg-sheet: #fdfbf7;
  --bg-card: #ffffff;
  --bg-input: #f8f6f0;
  
  --ink-primary: #141312;
  --ink-secondary: #3b3834;
  --ink-dim: #6e685f;

  --rule-strong: #141312;
  --rule-subtle: #d6cfbf;
  --crease-shadow: rgba(0, 0, 0, 0.05);

  --accent-vermilion: #b31d28;
  --accent-vermilion-subtle: rgba(179, 29, 40, 0.08);
  --accent-gold: #966f1e;

  --input-border: #b8b09f;
  --input-focus: #141312;
  --btn-bg: #141312;
  --btn-text: #fcfaf4;

  --nav-bg: #1b1916;
  --nav-text: #e8e3d8;

  --stamp-color: #b31d28;
  --shadow-sheet: rgba(45, 35, 20, 0.22);
}

/* ====================================================================
   THEME 2: NIGHT PRESSROOM (Modern Dark Edition)
   ==================================================================== */
[data-theme="night"] {
  --bg-body: #080a10;
  --bg-sheet: #111622;
  --bg-card: #171e2c;
  --bg-input: #0d121c;

  --ink-primary: #f8fafc;
  --ink-secondary: #94a3b8;
  --ink-dim: #64748b;

  --rule-strong: #334155;
  --rule-subtle: #242d3d;
  --crease-shadow: rgba(255, 255, 255, 0.03);

  --accent-vermilion: #ef4444;
  --accent-vermilion-subtle: rgba(239, 68, 68, 0.14);
  --accent-gold: #f59e0b;

  --input-border: #334155;
  --input-focus: #ef4444;
  --btn-bg: #ef4444;
  --btn-text: #ffffff;

  --nav-bg: #090c12;
  --nav-text: #e2e8f0;

  --stamp-color: #ef4444;
  --shadow-sheet: rgba(0, 0, 0, 0.75);
}

/* Base Reset & Mobile Touch Optimizations */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--ink-primary);
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport height for mobile browsers */
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.lang-kn {
  font-family: var(--font-kn), var(--font-sans);
}

/* Background Animated Canvas */
#animated-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Ambient Floating Orbs */
.ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-vermilion) 0%, transparent 70%);
  top: -150px;
  left: -100px;
}

.orb-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-gold) 0%, transparent 70%);
  bottom: -120px;
  right: -80px;
  animation-duration: 25s;
  animation-delay: -6s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 70px) scale(0.92); }
}

/* Texture Grain Overlay */
.paper-grain {
  position: fixed;
  inset: 0;
  opacity: 0.045;
  pointer-events: none;
  background-image: radial-gradient(#000 1px, transparent 1px);
  background-size: 4px 4px;
  z-index: 10;
}

/* ====================================================================
   Top Animated Newsroom Ribbon
   ==================================================================== */
.news-top-nav {
  background-color: var(--nav-bg);
  color: var(--nav-text);
  padding: 6px 16px;
  font-size: 0.76rem;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: max(6px, env(safe-area-inset-top));
}

.nav-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ticker-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0; /* Prevents flex children from breaking layout */
  overflow: hidden;
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-vermilion);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 3px;
  letter-spacing: 0.6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pulse-beacon {
  width: 6px;
  height: 6px;
  background-color: #fff;
  border-radius: 50%;
  animation: pulseBeacon 1.2s infinite;
}

@keyframes pulseBeacon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.65); }
}

.ticker-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-text {
  display: inline-block;
  padding-left: 100%;
  animation: scrollTicker 30s linear infinite;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.74rem;
}

.ticker-track:hover .ticker-text {
  animation-play-state: paused;
}

@keyframes scrollTicker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.live-clock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.utility-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--nav-text);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  min-height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.utility-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* ====================================================================
   3D Tilting Newspaper Sheet Container
   ==================================================================== */
.page-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 14px 32px 14px;
  position: relative;
  z-index: 5;
  width: 100%;
}

.card-3d-wrapper {
  perspective: 1200px;
  width: 100%;
  max-width: 680px;
}

.newspaper-sheet {
  width: 100%;
  background-color: var(--bg-sheet);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 24px 50px var(--shadow-sheet), 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 32px 36px 24px 36px;
  position: relative;
  transition: transform 0.12s ease-out, background-color 0.3s ease, border-color 0.3s ease;
  transform-style: preserve-3d;
  animation: unfoldPaper 0.9s var(--ease-editorial) forwards;
}

@keyframes unfoldPaper {
  0% {
    opacity: 0;
    transform: rotateX(16deg) scale(0.93) translateY(30px);
  }
  100% {
    opacity: 1;
    transform: rotateX(0deg) scale(1) translateY(0);
  }
}

/* Dynamic Light Sheen Overlay */
.sheen-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.12) 0%, transparent 65%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

/* Visual vertical newspaper crease */
.newspaper-crease {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, var(--crease-shadow) 20%, var(--crease-shadow) 80%, transparent 100%);
  pointer-events: none;
}

/* ====================================================================
   1. Masthead
   ==================================================================== */
.masthead {
  border-bottom: 3px double var(--rule-strong);
  padding-bottom: 12px;
  margin-bottom: 22px;
  text-align: center;
}

.masthead-top-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 5px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.masthead-top-rule .motto {
  font-family: var(--font-kn);
  color: var(--accent-vermilion);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: none;
}

.masthead-title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0;
}

.flourish-line {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--rule-strong));
  transition: transform 0.4s ease;
}

.flourish-right {
  background: linear-gradient(90deg, var(--rule-strong), transparent);
}

.newspaper-sheet:hover .flourish-left {
  transform: translateX(-4px);
}

.newspaper-sheet:hover .flourish-right {
  transform: translateX(4px);
}

.titles-wrapper {
  padding: 0 16px;
}

.kannada-brand {
  font-family: var(--font-kn);
  font-size: clamp(1.15rem, 4.5vw, 1.35rem);
  font-weight: 800;
  color: var(--accent-vermilion);
  line-height: 1.15;
  letter-spacing: 0.5px;
}

.english-brand {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6.8vw, 2.6rem);
  font-weight: 900;
  letter-spacing: clamp(1.5px, 0.8vw, 3px);
  line-height: 1.05;
  color: var(--ink-primary);
  margin: 3px 0;
}

.brand-tagline {
  font-size: clamp(0.6rem, 2.3vw, 0.68rem);
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.masthead-bottom-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--rule-strong);
  padding-top: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ink-secondary);
}

.center-secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-vermilion);
  position: relative;
}

.secure-pulse-ring {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-vermilion);
  animation: pulseBeacon 1.4s infinite;
}

/* ====================================================================
   2. Sign In Card
   ==================================================================== */
.signin-section {
  max-width: 440px;
  margin: 0 auto 18px auto;
  width: 100%;
}

.signin-card {
  background-color: var(--bg-card);
  border: 1.5px solid var(--rule-strong);
  padding: 26px 24px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  width: 100%;
}

.card-header {
  text-align: center;
  margin-bottom: 18px;
}

.card-header-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
}

.badge-line {
  flex: 1;
  max-width: 45px;
  height: 1.5px;
  background: var(--accent-vermilion);
  transition: max-width 0.3s ease;
}

.signin-card:hover .badge-line {
  max-width: 55px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink-primary);
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--ink-dim);
  line-height: 1.4;
}

/* Status / Alert Toast */
.status-toast {
  padding: 9px 12px;
  border: 1.5px solid var(--rule-strong);
  margin-bottom: 16px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeInToast 0.25s ease;
  word-break: break-word;
}

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

.status-toast.info {
  background: rgba(56, 189, 248, 0.1);
  border-color: #0284c7;
  color: #0284c7;
}

.status-toast.success {
  background: rgba(22, 163, 74, 0.12);
  border-color: #16a34a;
  color: #15803d;
}

.status-toast.error {
  background: var(--accent-vermilion-subtle);
  border-color: var(--accent-vermilion);
  color: var(--accent-vermilion);
  animation: shakeAlert 0.4s ease;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.hidden {
  display: none !important;
}

/* Form Fields (16px base font prevents iOS Safari auto-zoom) */
.form-field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--ink-secondary);
  margin-bottom: 5px;
}

.label-with-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  flex-wrap: wrap;
  gap: 4px;
}

.forgot-pwd-link {
  font-size: 0.74rem;
  color: var(--accent-vermilion);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.18s ease;
  padding: 2px 0;
}

.forgot-pwd-link:hover {
  color: var(--ink-primary);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.field-icon {
  position: absolute;
  left: 12px;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.news-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--input-border);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 1rem; /* 16px prevents iOS Safari auto-zoom */
  padding: 12px 14px 12px 40px;
  border-radius: 0;
  outline: none;
  min-height: 48px; /* Standard 48px touch target */
  transition: all 0.2s ease;
}

.news-input:focus {
  border-color: var(--input-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.input-wrap:focus-within .field-icon {
  color: var(--accent-vermilion);
  transform: scale(1.1);
}

/* Animated bottom ink bar under input */
.input-glow-bar {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-vermilion);
  transition: width 0.3s ease, left 0.3s ease;
  pointer-events: none;
}

.news-input:focus + .input-glow-bar {
  width: 100%;
  left: 0;
}

.eye-toggle {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--ink-dim);
  cursor: pointer;
  padding: 8px 10px;
  min-height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.eye-toggle:hover {
  color: var(--ink-primary);
}

/* Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--ink-secondary);
  min-height: 24px;
}

.checkbox-container input {
  display: none;
}

.checkbox-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--rule-strong);
  background: var(--bg-input);
  display: inline-block;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.checkbox-container input:checked + .checkbox-box {
  background: var(--rule-strong);
}

.checkbox-container input:checked + .checkbox-box::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 3.5px;
  height: 7.5px;
  border: solid var(--bg-sheet);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.security-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-dim);
}

.chip-dot {
  width: 5px;
  height: 5px;
  background: var(--accent-gold);
  border-radius: 50%;
}

/* Primary Button with Shimmer & Ripple */
.btn-newspaper-signin {
  width: 100%;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 13px 20px;
  min-height: 48px; /* Accessible mobile touch target */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  transition: transform 0.18s var(--ease-spring), background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Button sweeping shimmer */
.btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: 0.5s ease;
}

.btn-newspaper-signin:hover {
  background: var(--accent-vermilion);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(179, 29, 40, 0.35);
}

.btn-newspaper-signin:hover .btn-shimmer {
  left: 140%;
}

.btn-newspaper-signin:active {
  transform: translateY(1px);
}

.btn-arrow {
  transition: transform 0.2s ease;
}

.btn-newspaper-signin:hover .btn-arrow {
  transform: translateX(5px);
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Quick Demo Hint */
.demo-account-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.74rem;
  color: var(--ink-dim);
  flex-wrap: wrap;
}

.demo-pill {
  background: var(--bg-input);
  border: 1px solid var(--rule-subtle);
  color: var(--accent-vermilion);
  font-family: monospace;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 8px;
  min-height: 28px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-pill:hover,
.demo-pill:active {
  border-color: var(--accent-vermilion);
  background: var(--bg-card);
  transform: scale(1.03);
}

/* Card Wax Seal Footer with Concentric Halo */
.card-footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.seal-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-vermilion);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring);
}

.seal-halo {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-vermilion);
  opacity: 0.4;
  animation: pulseHalo 2.5s infinite ease-in-out;
}

@keyframes pulseHalo {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.seal-icon:hover {
  transform: scale(1.15) rotate(6deg);
}

.seal-icon span {
  font-family: var(--font-kn);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1;
}

.seal-text strong {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.5px;
  color: var(--ink-primary);
}

.seal-text span {
  display: block;
  font-size: 0.68rem;
  color: var(--ink-dim);
}

/* ====================================================================
   Rubber Stamp Verification Animation with Responsive Scaling
   ==================================================================== */
.rubber-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  border: 3.5px double var(--stamp-color);
  padding: 10px 20px;
  max-width: 90%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px var(--stamp-color), 0 12px 30px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 50;
  animation: stampSlam 0.4s var(--ease-spring) forwards;
}

[data-theme="night"] .rubber-stamp {
  background: rgba(18, 23, 34, 0.96);
}

@keyframes stampSlam {
  0% {
    transform: translate(-50%, -50%) scale(2.4) rotate(-35deg);
    opacity: 0;
  }
  60% {
    transform: translate(-50%, -50%) scale(0.94) rotate(-8deg);
    opacity: 1;
  }
  80% {
    transform: translate(-50%, -50%) scale(1.04) rotate(-14deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(-12deg);
    opacity: 1;
  }
}

.stamp-border {
  text-align: center;
  display: flex;
  flex-direction: column;
}

.stamp-verified {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5.5vw, 1.7rem);
  font-weight: 900;
  color: var(--stamp-color);
  letter-spacing: 2px;
  line-height: 1;
}

.stamp-title {
  font-size: clamp(0.55rem, 2.5vw, 0.68rem);
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--stamp-color);
  border-top: 1.5px solid var(--stamp-color);
  border-bottom: 1.5px solid var(--stamp-color);
  padding: 2px 0;
  margin: 2px 0;
}

.stamp-date {
  font-family: monospace;
  font-size: clamp(0.62rem, 2.6vw, 0.72rem);
  font-weight: 700;
  color: var(--stamp-color);
}

/* ====================================================================
   3. Newspaper Footer
   ==================================================================== */
.newspaper-footer {
  border-top: 3px double var(--rule-strong);
  padding-top: 12px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--ink-dim);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-help a {
  color: var(--accent-vermilion);
  text-decoration: underline;
}

/* ====================================================================
   Modal Window
   ==================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 17, 16, 0.78);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-window {
  background: var(--bg-sheet);
  border: 2px solid var(--rule-strong);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  max-width: 380px;
  width: 100%;
  padding: 26px 20px;
  position: relative;
  text-align: center;
  animation: modalPop 0.22s var(--ease-spring) forwards;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--ink-dim);
  cursor: pointer;
  line-height: 1;
  padding: 6px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--ink-primary);
}

.modal-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 4px;
}

.modal-desc {
  font-size: 0.8rem;
  color: var(--ink-dim);
  margin-bottom: 16px;
  line-height: 1.4;
}

.reset-success {
  margin-top: 12px;
  padding: 8px;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ====================================================================
   Comprehensive Mobile & Tablet Breakpoints
   ==================================================================== */

/* Tablet & Smaller Laptops (<= 768px) */
@media (max-width: 768px) {
  .page-container {
    padding: 16px 12px 28px 12px;
  }

  .newspaper-sheet {
    padding: 24px 20px 20px 20px;
  }

  .live-clock-badge {
    display: none;
  }

  /* Disable 3D transforms on touch devices for fluid performance */
  .newspaper-sheet {
    transform: none !important;
  }

  .sheen-overlay {
    display: none;
  }
}

/* Mobile Screens (<= 580px) */
@media (max-width: 580px) {
  .news-top-nav {
    padding: 6px 10px;
  }

  .nav-content {
    gap: 8px;
  }

  .ticker-label {
    font-size: 0.58rem;
    padding: 2px 5px;
  }

  .ticker-text {
    font-size: 0.7rem;
  }

  .utility-btn {
    padding: 3px 6px;
    font-size: 0.7rem;
  }

  #theme-label {
    display: none; /* Icon-only on mobile */
  }

  .newspaper-sheet {
    padding: 18px 14px 16px 14px;
    border-width: 1px;
    box-shadow: 0 10px 25px var(--shadow-sheet);
  }

  .newspaper-crease {
    display: none; /* Hide fold crease on narrow mobile for cleanliness */
  }

  .masthead {
    padding-bottom: 10px;
    margin-bottom: 16px;
  }

  .masthead-top-rule {
    font-size: 0.65rem;
    padding-bottom: 4px;
    margin-bottom: 8px;
  }

  .masthead-top-rule .motto {
    display: none; /* Prevent clutter on small phones */
  }

  .flourish-line {
    display: none; /* Cleaner title presentation */
  }

  .titles-wrapper {
    padding: 0 4px;
  }

  .masthead-bottom-rule {
    font-size: 0.64rem;
    padding-top: 4px;
  }

  .signin-card {
    padding: 20px 14px;
    border-width: 1px;
  }

  .card-header {
    margin-bottom: 14px;
  }

  .card-header-badge {
    gap: 8px;
  }

  .badge-line {
    max-width: 25px;
  }

  .form-field {
    margin-bottom: 14px;
  }

  .form-options {
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .btn-newspaper-signin {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .card-footer {
    margin-top: 18px;
    padding-top: 12px;
    gap: 10px;
  }

  .seal-icon {
    width: 32px;
    height: 32px;
  }

  .seal-icon span {
    font-size: 1.15rem;
  }

  .seal-text strong {
    font-size: 0.7rem;
  }

  .seal-text span {
    font-size: 0.64rem;
  }

  .footer-row {
    flex-direction: column;
    text-align: center;
    gap: 4px;
    font-size: 0.68rem;
  }
}

/* Extra Small Phones (<= 380px) */
@media (max-width: 380px) {
  .page-container {
    padding: 10px 8px 20px 8px;
  }

  .newspaper-sheet {
    padding: 14px 10px 14px 10px;
  }

  .signin-card {
    padding: 16px 10px;
  }

  .news-input {
    padding: 10px 10px 10px 36px;
  }

  .field-icon {
    left: 10px;
  }

  .masthead-bottom-rule span:first-child {
    display: none; /* Keep center badge & date only */
  }

  .rubber-stamp {
    padding: 6px 12px;
    border-width: 2.5px;
  }
}
