:root {
  --primary-color: #0070f3;
  --hover-color: #005dca;
  --background-color: #f5f5f5;
  --text-color: #333;
  --border-color: #e0d0b7;
  --white: #fff;
  --disabled-opacity: 0.5;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  height: 100vh;
  overflow: hidden;
  touch-action: none;
  -webkit-overflow-scrolling: none;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.signature-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Header styles kept for reference if needed later */
.header {
  width: 100%;
  text-align: center;
  padding-bottom: 0.5rem;
}

.header h1 {
  font-size: 1.5rem;
  color: #333;
  font-weight: 600;
}

.canvas-container {
  position: relative;
  width: 95%;
  /* Increased height since header was removed */
  height: 85vh;
  margin: 0.5rem auto;
  flex: 1;
}

#signatureCanvas {
  width: 100%;
  height: 100%;
  background-color: #fff;
  border: 2px solid #e0d0b7;
  border-radius: 0.5rem;
  cursor: crosshair;
  touch-action: none;
}

#loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loading-content {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: #8b6e44;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-content p {
  color: #333;
  font-size: 1.125rem;
}

.button-container {
  display: flex;
  gap: 1rem;
  width: 95%;
  margin: 0.5rem auto;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0.5rem);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-button {
  background-color: #8b6e44;
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background-color: #74593a;
}

.secondary-button {
  background-color: #e0d0b7;
  color: #333;
}

.secondary-button:hover:not(:disabled) {
  background-color: #d6c4a6;
}

@media (max-width: 768px) {
  .signature-container {
    padding: 0.5rem 0.25rem;
  }

  .canvas-container {
    width: 98%;
    height: 80vh;
  }

  .button-container {
    width: 98%;
  }

  .button {
    padding: 0.75rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .signature-container {
    padding: 0.5rem 0.25rem;
  }

  .canvas-container {
    width: 98%;
    height: 75vh;
  }

  .button {
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
  }
}