/* Landing Page - Wax Seal Animation */

.landing-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.landing-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--background);
  -webkit-perspective: 1000px;
  perspective: 1000px;
}

/* Envelope Wrapper */
.envelope-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-transition: transform var(--transition-slower);
  transition: transform var(--transition-slower);
}

.envelope-wrapper.opening {
  animation: envelopeShake 0.5s ease-in-out;
}

/* Envelope Parts */
.envelope-front,
.envelope-back {
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--envelope-color);
  border: none;
  border-radius: 0;
}

.envelope-back {
  z-index: 1;
}

.envelope-front {
  z-index: 3;
  position: relative;
}

/* Envelope Center Crease */
.envelope-front::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--envelope-crease) 20%,
    var(--envelope-crease) 80%,
    transparent 100%);
  opacity: 0.3;
}

/* Envelope Flap */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50vh;
  background: var(--envelope-color);
  border: none;
  border-radius: 0;
  -webkit-transform-origin: top center;
  transform-origin: top center;
  -webkit-transform: rotateX(0deg);
  transform: rotateX(0deg);
  -webkit-transition: transform var(--transition-slower) var(--ease-smooth);
  transition: transform var(--transition-slower) var(--ease-smooth);
  z-index: 4;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 30%, 50% 100%, 0 30%);
  clip-path: polygon(0 0, 100% 0, 100% 30%, 50% 100%, 0 30%);
  box-shadow: 
    0 4px 20px var(--envelope-shadow);
}

.envelope-wrapper.opening .envelope-flap {
  -webkit-transform: rotateX(-180deg);
  transform: rotateX(-180deg);
  -webkit-transition-delay: 0.3s;
  transition-delay: 0.3s;
}

/* Wax Seal Container */
.wax-seal-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-style: flat;
  z-index: 5;
  cursor: pointer;
  transition: transform var(--transition-normal);
}

.wax-seal-container:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.wax-seal-container.breaking {
  animation: sealBreak 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  pointer-events: none;
}

/* Wax Seal */
.wax-seal {
  width: 180px;
  height: 180px;
  background: var(--wax-seal);
  border-radius: var(--radius-round);
  box-shadow: 
    inset 0 -6px 20px rgba(0, 0, 0, 0.3),
    inset 0 6px 20px rgba(255, 255, 255, 0.08),
    0 10px 40px rgba(0, 0, 0, 0.35),
    0 4px 12px rgba(75, 75, 28, 0.5);
  position: relative;
  transition: all var(--transition-normal);
  border: 2px solid rgba(212, 168, 67, 0.4);
}

.wax-seal::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 15%;
  width: 35%;
  height: 35%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(4px);
}

.wax-seal-container:hover .wax-seal {
  box-shadow: 
    inset 0 -6px 20px rgba(0, 0, 0, 0.35),
    inset 0 6px 20px rgba(255, 255, 255, 0.12),
    0 14px 55px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(75, 75, 28, 0.6);
  transform: scale(1.03);
}

.seal-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  background: transparent;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  box-shadow: 
    inset 0 0 30px rgba(75, 75, 28, 0.1);
  border: 1px solid rgba(75, 75, 28, 0.15);
}

.monogram {
  font-family: var(--font-monogram);
  font-size: 3rem;
  font-weight: 400;
  color: #D4A843;
  -webkit-text-stroke: 0.5px #B8901E;
  text-shadow: 
    0 1px 3px rgba(180, 130, 20, 0.5),
    0 0 12px rgba(212, 168, 67, 0.3);
  letter-spacing: 0.02em;
  position: relative;
  line-height: 1;
  margin-top: 0.05em;
}

.seal-shadow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.1) 100%);
  border-radius: 50%;
  transform: scale(1.3);
  z-index: -1;
}

/* Instruction Text */
.instruction-text {
  margin-top: var(--space-2xl);
  font-family: var(--font-primary);
  font-size: var(--body-large);
  color: var(--text-secondary);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: lowercase;
  font-style: italic;
  font-weight: var(--weight-light);
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.8s forwards;
}

/* Email Section */
.email-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility 0s var(--transition-slow);
  z-index: 10;
}

.email-section.active {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--transition-slow);
}

.email-container {
  width: 100%;
  max-width: 500px;
  padding: var(--space-lg);
}

.email-card {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-2xl) var(--space-xl);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04);
  text-align: center;
  animation: slideUpFade 0.6s ease-out;
  position: relative;
}

.email-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text-primary);
}

.email-card h1 {
  font-family: var(--font-primary);
  font-size: var(--h2-size);
  font-weight: var(--weight-regular);
  margin-bottom: var(--space-md);
  margin-top: var(--space-md);
  color: var(--text-primary);
  letter-spacing: var(--letter-spacing-wide);
}

.subtitle {
  font-size: var(--body-regular);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-weight: var(--weight-regular);
  line-height: var(--line-height-relaxed);
}

/* Email Form */
.email-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  position: relative;
  text-align: left;
}

.form-group input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: var(--body-regular);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  background: var(--background);
  font-family: var(--font-secondary);
}

.form-group input:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--card-background);
  box-shadow: 0 0 0 3px hsla(345, 63%, 41%, 0.1);
}

.form-group label {
  position: absolute;
  top: -0.6rem;
  left: 1rem;
  background: var(--card-background);
  padding: 0 0.5rem;
  font-size: var(--body-small);
  color: var(--text-primary);
  font-weight: var(--weight-medium);
  letter-spacing: var(--letter-spacing-normal);
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-loader {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
}

.loader-dot {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  animation: loaderBounce 1.4s infinite ease-in-out both;
}

.loader-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loader-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.form-error {
  color: var(--error-color);
  font-size: var(--body-small);
  font-weight: var(--weight-medium);
  margin-top: var(--space-sm);
  min-height: 1rem;
  display: block;
  text-align: center;
}

/* Error Page */
.error-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility 0s var(--transition-slow);
  z-index: 15;
}

.error-page.active {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--transition-slow);
}

.error-container {
  width: 100%;
  max-width: 600px;
  padding: var(--space-lg);
}

.error-card {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-2xl) var(--space-xl);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04);
  text-align: center;
  animation: slideUpFade 0.6s ease-out;
  position: relative;
}

.error-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text-primary);
}

.error-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  margin-top: var(--space-sm);
  opacity: 0.9;
}

.error-card h1 {
  font-family: var(--font-primary);
  font-size: var(--h3-size);
  font-weight: var(--weight-regular);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: var(--letter-spacing-wide);
}

.error-message {
  font-size: var(--body-large);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.error-info {
  font-size: var(--body-regular);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.contact-info {
  background: #F9F9F9;
  padding: var(--space-lg);
  border-radius: var(--radius-sm);
  margin: var(--space-lg) 0;
  border: 1px solid var(--border-color);
}

.contact-info p {
  margin-bottom: var(--space-sm);
  font-size: var(--body-regular);
  line-height: var(--line-height-relaxed);
}

.contact-info p:last-child {
  margin-bottom: 0;
}

.contact-info a {
  color: var(--link-color);
  font-weight: var(--weight-medium);
  transition: color var(--transition-fast);
  text-decoration: underline;
}

.contact-info a:hover {
  color: var(--link-hover);
}

.error-actions {
  margin-top: var(--space-xl);
}

/* Responsive Design */
@media (max-width: 768px) {
  .wax-seal {
    width: 150px;
    height: 150px;
  }
  
  .seal-inner {
    width: 115px;
    height: 115px;
  }
  
  .monogram {
    font-size: 2.2rem;
  }
  
  .email-card,
  .error-card {
    padding: var(--space-xl);
  }
}

@media (max-width: 480px) {
  .wax-seal {
    width: 120px;
    height: 120px;
  }
  
  .seal-inner {
    width: 90px;
    height: 90px;
  }
  
  .monogram {
    font-size: 1.8rem;
  }
}
