:root {
  --color-primary-blue: #2563eb;
  --color-secondary-blue: #1d4ed8;
  --color-primary-white: #f8fafc;
  --color-secondary-white: #e0e7ef;
  --color-shadow: rgba(0, 0, 0, 0.4);
  --color-bg-white: #f1f5f9;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--color-primary-white);
  color: #222;
  min-height: 100vh;
}

h1 {
  text-align: center;
  margin-top: 2rem;
  font-size: 2rem;
  letter-spacing: 0.05em;
}

form {
  max-width: 400px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px var(--color-shadow);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

label {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

input[type='file'], select {
  font-size: 1rem;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: var(--color-bg-white);
}


button[type='submit'] {
  background: var(--color-primary-blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.7rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
}

button[type='submit']:hover {
  background: var(--color-secondary-blue);
}

form.loading,
.styled-form.loading,
.result-form.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

form.loading::after,
.styled-form.loading::after,
.result-form.loading::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.7);
  z-index: 2;
  pointer-events: all;
  border-radius: 16px;
}

form.loading::before,
.styled-form.loading::before,
.result-form.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: -1.25rem;
  margin-left: -1.25rem;
  border-radius: 50%;
  border: 4px solid #2563eb;
  border-top: 4px solid #e0e7ef;
  animation: spinner-rotate 0.8s linear infinite;
  z-index: 3;
  pointer-events: none;
}

form.loading::after,
.styled-form.loading::after,
.result-form.loading::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.6);
  z-index: 2;
  pointer-events: all;
}

form.loading::before,
.styled-form.loading::before,
.result-form.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: -1.25rem;
  margin-left: -1.25rem;
  border-radius: 50%;
  border: 4px solid #2563eb;
  border-top: 4px solid #e0e7ef;
  animation: spinner-rotate 0.8s linear infinite;
  z-index: 3;
  pointer-events: none;
}

@keyframes spinner-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


@keyframes disabled-pulse {
  0% {
    filter: brightness(1);
  }
  100% {
    filter: brightness(0.93);
  }
}

.qrcode-container {
  padding-bottom: 1rem;
}

.qrcode-container img {
  width: 180px;
  height: 180px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background: var(--color-bg-white);
  box-shadow: 0 1px 4px var(--color-shadow);
}

.anony-link-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.1rem;
  word-break: break-all;
}

.result-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.result-form label {
  font-size: 1.2rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.2rem;
  letter-spacing: 0.01em;
}

.section-separator {
  border: none;
  border-top: 2px solid #cbd5e1;
  margin: 0.5rem 0 0.5rem 0;
  width: 100%;
  opacity: 0.7;
}

.token-container, .expires-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.1rem;
  word-break: break-all;
}

.token-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto) 1fr;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.5rem;
}

.token-part {
  background: var(--color-bg-white);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  font-size: 1.1rem;
  text-align: center;
  font-family: 'Menlo', 'Consolas', monospace;
  font-weight: 600;
  color: #334155;
  box-shadow: 0 1px 4px var(--color-shadow);
}

.token-part.checksum {
  grid-column: 1 / span 2;
  background: var(--color-secondary-white);
  font-weight: 600;
  color: var(--color-primary-blue);
  border: 1px solid #cbd5e1;
}

@media (max-width: 600px) {
  .result-form, .styled-form {
    max-width: 98vw;
    padding: 1.2rem 0.5rem;
  }
  .qrcode-container img {
    width: 120px;
    height: 120px;
  }
}

.copy-button-container {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  justify-content: center;
}

.copy-button {
  padding: 0.3rem 0.8rem;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: var(--color-bg-white);
  color: var(--color-primary-blue);
  font-weight: 600;
  cursor: pointer;
}

.background-accent {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(120deg, var(--color-secondary-white) 0%, var(--color-primary-white) 100%);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}

.main-title {
  text-align: center;
  margin-top: 2.5rem;
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--color-primary-blue);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.icon-confirm {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  background: url('data:image/svg+xml;utf8,<svg fill="%23fff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 13l4 4L19 7" stroke="%23fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center center;
  background-size: contain;
  vertical-align: middle;
  margin-right: 0.3em;
}

.result-form, .styled-form {
  max-width: 420px;
  margin: 2.5rem auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(37,99,235,0.08);
  padding: 2.2rem 2rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.styled-form label {
  color: var(--color-primary-blue);
  font-weight: 600;
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.modern-btn {
  background: linear-gradient(90deg, var(--color-primary-blue) 60%, var(--color-secondary-blue) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.4rem;
  font-size: 1.08rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1.2rem;
  box-shadow: 0 2px 8px rgba(37,99,235,0.07);
  transition: background 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modern-btn:hover {
  background: linear-gradient(90deg, var(--color-secondary-blue) 60%, var(--color-primary-blue) 100%);
  box-shadow: 0 4px 16px rgba(37,99,235,0.12);
}
