:root {
  --color-bg: #162641;
  --color-fg: #ffffff;
  --color-accent: #204D8E;
  --color-accent-dark: #1E4D8E;
  --color-muted: #ddd;
  --color-placeholder: #ededed;
  --color-highlight: #54CCFF;
  --color-dark-bg: #111;
  --color-dark-fg: #f1f1f1;
  --color-border: #54CCFF;

  --font-body: sans-serif;
  --font-monospace: Arial, sans-serif;

  --radius-small: 4px;
  --radius-med: 16px;
  --radius-pill: 30px;

  --space-xs: 0.5em;
  --space-sm: 1em;
  --space-md: 2em;

  --max-width-main: 30rem;
  --preview-min-width: 300px;
}

* {
	opacity:1;
  transition: opacity 0.5s ease-in-out;
}

body {
  font-family: var(--font-body);
  padding: var(--space-md);
	padding-top:0;
	margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 30vh;
  text-align: center;
}

main {
  text-align: center;
  max-width: var(--max-width-main);
  width: 100%;
}

h1 {
  line-height: 1.1;
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: 0.1rem;
	background: rgba(0,0,0,0.5);
	width:100vw;
	margin: 0;
	padding: 1rem 0;
	color:#1E69AB;
}
h1 img {
	margin-bottom: 8px;
	font-weight: bolder;
	font-size: 1.2rem;
}

h3 {
  color: var(--color-border);
  text-transform: uppercase;
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--color-border);
  width: 150px;
  margin: 0 auto var(--space-sm);
}

h4 {
  margin: 0;
}

.highlight {
  color: var(--color-highlight);
	cursor: pointer;
}

.no-copy {
  user-select: none;
}

#instructions {
  margin: 0 auto;
}

#actions {
  margin: 0 auto;
  display: none;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

button,
#actions button {
  background: #227E00;
  color: var(--color-fg);
  border: none;
  border-radius: var(--radius-med);
  padding: var(--space-xs) var(--space-sm);
  font-size: 1.1em;
  cursor: pointer;
  margin-top: var(--space-xs);
}

#actions button {
  background: #454545;
  font-size: 11px;
  padding: 5px 15px;
  border-radius: var(--radius-pill);
  color: var(--color-muted);
	text-transform: uppercase;
}

.restore {
  display: block;
  line-height: 1;
  font-style: normal;
	text-transform: none;
}

#btn-instructions {
  margin-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: center;
  line-height: 1;
}
#select-plaintext {
	font-size: inherit;
  padding: 0;
  background: none;
  color: #49982B;
  font-style: italic;
  margin: 0;
  border-radius: 0;
}

#toggle-theme {
  position: absolute;
  top: 4.5rem;
  right: -1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 3.5rem;
  font-size: 0.8rem;
  text-align: center;
  z-index: 1000;
  padding: 6px 12px 10px;
  background: var(--color-accent-dark);
  color: var(--color-fg);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}

#toggle-theme.islight {
  background: #000;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}


/* Signature styles */
.sig-wrap {
  position: relative;
  margin: var(--space-sm) auto;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}

#signature {
  background: #fefefe;
  text-align: left;
}

#signature.dark-mode {
  background-color: var(--color-dark-bg);
}

#signature.dark-mode a,
#signature.dark-mode a > font,
#signature.dark-mode td > span > strong > span {
  color: #3875BE !important;
}

#signature.dark-mode div,
#signature.dark-mode td,
#signature.dark-mode span,
#signature.dark-mode p,
#signature.dark-mode a,
#signature.dark-mode a:not([href]) > font,
#signature.dark-mode font{
  color: var(--color-dark-fg) !important;
}


#signature.dark-mode img {
  filter: brightness(1.05) !important;
}

#signature.dark-mode td.blue {
  border-top-color: #1D579C !important;
}

#signature.dark-mode td.placeholder {
  border-bottom: 2px solid var(--color-dark-bg);
  color: #bccbdc !important;
  background: #25313f;
}

.preview {
  min-width: var(--preview-min-width);
  margin: var(--space-sm) auto;
  border-radius: 5px;
  padding: 1.5em 2em;
}

td.placeholder {
  background: var(--color-placeholder);
  padding: 3px;
  border-radius: 5px;
  border-bottom: 2px solid #fff;
}

/* Plaintext Section */
#plaintext {
  white-space: pre;
  border: 1px dashed var(--color-fg);
  font-family: var(--font-monospace);
  user-select: text;
  cursor: text;
  text-align: left;
}

#plaintext-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  display: none; /* overridden dynamically */
}

/* Copy instruction visibility toggles */
#copy-wysiwyg,
#copy-html {
  display: none;
}

/* Instruction navigation styles */
#sig-nav,
#text-nav {
  margin: 0;
  display: flex;
  gap: 0.5em;
  justify-content: center;
}

#sig-nav button,
#text-nav button {
  background: #333;
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
  border-radius: 0;
  border: none;
  color: var(--color-fg);
	font-size: 0.8rem;
}

#sig-nav button.active,
#text-nav button.active {
  background: #858585;
  color: #fff;
}

/* Instruction panels */
.sig-instr {
  display: none;
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: left;
}

.sig-instr.active {
  display: block;
}


.radio-wrap {
	display: flex;
	justify-content: center;
	gap: 1rem;
	margin:1rem auto 0;
}

.chooser-option {
  border: 1px solid #444;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.5rem;
  cursor: pointer;
	user-select: none;
}

.chooser-option .option-content {
	padding: 0.75rem 1rem;
	border-radius: 0.5rem;
	width:7rem;
	  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10+ and Edge */
  user-select: none; /* Standard syntax */
}

.chooser-option input[type="radio"]:checked + .option-content {
  border: 1px solid #54CCFF;
  background: rgba(84, 204, 255, 0.1);
}

.chooser-option label {
	user-select: none;
}

.chooser-option:hover {
  border-color: #54CCFF;
  background: rgba(84, 204, 255, 0.05);
}

.chooser-option input[type="radio"] {
  margin-top: 0.3rem;
  accent-color: #54CCFF;
	display:none;
}

.chooser-option div {
  cursor: pointer;
}

.chooser-option strong {
  display: block;
  font-size: 1rem;
}

.chooser-option small {
  font-size: 0.8rem;
  color: #ccc;
}


/* General logo style */
h1 img.logo {
  width: 125px;
  margin-bottom: 8px;
}

/* Instruction note block */
.instruction-note {
  display: block;
  margin-top: 5px;
}

/* Plain text section adjustments */
.btn-plaintext {
  display: block;
  margin: 1rem auto 0;
}

.plaintext-title {
  font-size: 1.1rem;
  margin: 0 auto;
  line-height: 1;
}

#copy-plaintext-container {
  margin-bottom: 0.25rem;
}

.btn-copy-plaintext {
  padding: 6px 12px;
}

.text-instructions {
  text-align: left;
}

.text-center {
  text-align: center;
}

.btn-select-plaintext {
  font-size: inherit;
  padding: 0;
  background: none;
  color: #49982B;
  font-style: italic;
  margin: 0;
  border-radius: 0;
}

/* Navigation centering */
.centered-nav {
  margin: 0 auto;
  text-align: center;
}


.hidden {
  opacity: 0 !important;
}


.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 50, 50, 0.95);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

#step1 h3 {
  display: none;
}



/* Responsive adjustments */
@media (max-width: 499px) {
  #toggle-theme {
    display: none !important;
  }

  .preview {
    padding: 1rem !important;
  }

  .sig-wrap {
    padding: 1.5rem 1rem 1rem !important;
  }

  body {
    padding: 0 !important;
  }
  
}