:root {
  --blue: #112337;
  --dark-blue: #071326;
  --gold: #d8a53b;
  --text: #151922;
  --muted: #6c757d;
  --border: #dcdcdc;
  --soft-bg: #f5f5f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: #ffffff;
  font-family: 'DM Sans', Arial, Helvetica, sans-serif;
}

.app-topbar {
  height: 70px;
  background: var(--blue);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-logo {
  display: block;
  width: auto;
  height: 42px;
  max-width: 150px;
  object-fit: contain;
}

.brand-title {
  font-size: 18px;
}

.app-main {
  padding: 30px 0 60px;
}

.screen {
  width: 100%;
}

.login-screen {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 38px 34px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 55px rgba(7, 19, 38, 0.12);
  text-align: center;
}

.login-card h1 {
  color: var(--dark-blue);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px;
}

.login-card p {
  color: var(--muted);
  margin-bottom: 24px;
}

.google-button-holder {
  display: flex;
  justify-content: center;
}

.profile-menu {
  position: relative;
}

.profile-toggle {
  border: 0;
  background: transparent;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}

.profile-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.65);
}

.profile-arrow {
  font-size: 14px;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: 56px;
  width: 260px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.profile-card-top {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.profile-card-top strong,
.profile-card-top span {
  display: block;
}

.profile-card-top strong:first-child {
  color: var(--dark-blue);
  font-size: 15px;
  margin-bottom: 10px;
}

.profile-card-top span {
  color: #2b3036;
  font-size: 14px;
  margin-bottom: 0;
  word-break: break-word;
}

.logout-button {
  width: 100%;
  border: 0;
  background: #ffffff;
  color: #111111;
  text-align: left;
  padding: 14px 22px;
  font-size: 14px;
}

.logout-button:hover {
  background: #f3f3f3;
}

.generator-container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
}

.notice-box {
  width: min(1110px, 100%);
  min-height: 96px;
  padding: 24px 30px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: #0b0731;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 20px rgba(7, 19, 38, 0.22);
  margin-left: auto;
  margin-right: auto;
}

.notice-icon {
  font-size: 29px;
  line-height: 1;
}

.notice-box h2 {
  color: var(--gold);
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: 1px;
}

.notice-box p {
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  letter-spacing: 0.3px;
}

.notice-box strong {
  color: var(--gold);
}

.form-card,
.result-card {
  width: min(1110px, 100%);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
}

.card-header-custom {
  background: #6d747b;
  color: #ffffff;
  padding: 13px 20px;
  font-size: 19px;
  font-weight: 800;
}

.form-label {
  color: #111111;
  font-size: 15px;
  margin-bottom: 8px;
}

.form-control[readonly] {
  background-color: #e9ecef;
  border-color: #cfd4da;
  color: #374151;
  cursor: default;
}

.btn-dark-custom {
  background: #687078;
  border-color: #687078;
  color: #ffffff;
  font-weight: 700;
  padding: 10px 16px;
}

.btn-dark-custom:hover,
.btn-dark-custom:focus {
  background: #555d65;
  border-color: #555d65;
  color: #ffffff;
}

.result-card {
  background: #eeeeee;
}

.result-card.is-loading .result-actions,
.result-card.is-loading .copy-status,
.result-card.is-loading .how-to-section {
  display: none !important;
}

.result-actions {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.copy-instruction {
  font-size: 15px;
  font-weight: 600;
  flex: 1 1 460px;
}

.copy-inline-btn {
  font-weight: 700;
  padding: 6px 13px;
  margin: 0 2px;
}

.action-buttons {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.action-button {
  min-width: 180px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  padding: 9px 14px;
  text-align: left;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(7, 19, 38, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(7, 19, 38, 0.12);
}

.action-button strong,
.action-button small {
  display: block;
  line-height: 1.1;
}

.action-button small {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.78;
  text-transform: lowercase;
}

.action-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
}

.action-button-gmail {
  color: var(--dark-blue);
  border: 1px solid #cfd8ea;
  background: #f7faff;
}

.action-button-gmail:hover,
.action-button-gmail:focus {
  color: var(--dark-blue);
  border-color: #9bb7ec;
  background: #edf4ff;
}

.action-button-gmail .action-icon {
  color: #ffffff;
  background: var(--blue);
}

.action-button-help {
  color: #3d2d0b;
  border: 1px solid #ead29b;
  background: #fff8e8;
}

.action-button-help:hover,
.action-button-help:focus {
  color: #3d2d0b;
  border-color: var(--gold);
  background: #fff2d5;
}

.action-button-help .action-icon {
  color: var(--dark-blue);
  background: var(--gold);
}

.signature-preview-wrap {
  position: relative;
  min-height: 220px;
  padding: 20px;
  overflow: visible;
  background: #eeeeee;
}

.signature-preview-wrap.is-loading {
  display: flex;
  align-items: flex-start;
  min-height: 260px;
}

.signature-preview {
  display: block;
  width: 600px;
  max-width: 100%;
  height: auto;
  min-height: 1px;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.signature-preview-wrap.is-loading .signature-preview {
  visibility: hidden;
}

.signature-loading {
  position: absolute;
  inset: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--dark-blue);
  font-size: 16px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(7, 19, 38, 0.08);
}

.signature-loading-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(17, 35, 55, 0.18);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: signature-spin 0.85s linear infinite;
}

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

.copy-status {
  margin: 0 20px 20px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.copy-status.success {
  background: #e9f8ef;
  color: #0f7a3b;
  border: 1px solid #bce8cc;
}

.copy-status.error {
  background: #fff0f0;
  color: #a91818;
  border: 1px solid #f3c2c2;
}

.how-to-section {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.tutorial-card {
  width: 100%;
  max-width: 960px;
  background: #ffffff;
  border: 1px solid rgba(7, 19, 38, 0.1);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(7, 19, 38, 0.12);
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.tutorial-header h3 {
  margin: 0;
  color: #071326;
  font-size: 22px;
  font-weight: 800;
}

.tutorial-header p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 14px;
}

.tutorial-carousel {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.tutorial-image-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: #f3f5f8;
  border: 1px solid rgba(7, 19, 38, 0.08);
}

.tutorial-image {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
}

.tutorial-label {
  position: absolute;
  left: 18px;
  bottom: 18px;
  background: rgba(7, 19, 38, 0.86);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.tutorial-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: #071326;
  color: #ffffff;
  font-size: 34px;
  line-height: 40px;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(7, 19, 38, 0.28);
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.tutorial-arrow:hover {
  background: #0b1f3d;
  transform: translateY(-50%) scale(1.05);
}

.tutorial-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tutorial-arrow-left {
  left: 14px;
}

.tutorial-arrow-right {
  right: 14px;
}

@media (max-width: 768px) {
  .tutorial-card {
    padding: 14px;
    border-radius: 18px;
  }

  .tutorial-header h3 {
    font-size: 18px;
  }

  .tutorial-arrow {
    width: 38px;
    height: 38px;
    font-size: 28px;
  }

  .tutorial-label {
    left: 12px;
    bottom: 12px;
    font-size: 13px;
    padding: 8px 12px;
  }
}

.gif-frame {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background: #f5f5f5;
  border: 1px dashed #b7b7b7;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.gif-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.copy-sandbox {
  position: fixed;
  left: -99999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .app-main {
    padding-top: 18px;
  }

  .brand-logo {
    height: 34px;
    max-width: 120px;
  }

  .brand-title {
    font-size: 16px;
  }

  .notice-box {
    padding: 18px;
    align-items: flex-start;
  }

  .notice-box p {
    font-size: 12px;
  }

  .card-header-custom {
    font-size: 17px;
  }

  .action-buttons {
    width: 100%;
  }

  .action-button {
    flex: 1 1 100%;
  }
}
