/* Home Page - Book Cover Design */

.home-page {
  min-height: 100vh;
  background-color: #FFFFFF;
  padding: var(--space-xl);
  font-family: 'EB Garamond', 'Libre Baskerville', serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-notebook {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 3 / 4;
  perspective: 2000px;
}

.home-notebook__cover {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, var(--leather-brown) 0%, #4A2E1F 50%, var(--leather-brown) 100%),
    radial-gradient(ellipse at 30% 40%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(0, 0, 0, 0.15) 0%, transparent 60%);
  border-radius: 8px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transform-origin: left center;
  backface-visibility: hidden;
  border: 1px solid rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

/* Decorative cover elements */
.home-notebook__cover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.1) 0%, transparent 50%),
    repeating-linear-gradient(45deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 4px);
  pointer-events: none;
}

.home-notebook__spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.3), transparent);
  border-radius: 8px 0 0 8px;
}

.home-notebook__content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  z-index: 1;
}

/* Created At in Top Right */
.home-notebook__created-at {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  font-family: 'EB Garamond', 'Libre Baskerville', serif;
  font-size: var(--text-sm);
  color: var(--paper-aged);
  opacity: 0.8;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.home-notebook__flash {
  position: absolute;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  z-index: 10;
}

.home-notebook__flash-message {
  padding: var(--space-sm) var(--space-md);
  border-radius: 4px;
  font-family: 'EB Garamond', 'Libre Baskerville', serif;
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-xs);
  border-left: 3px solid;
  background-color: rgba(255, 255, 255, 0.95);
}

.home-notebook__flash-message:last-child {
  margin-bottom: 0;
}

.home-notebook__flash-message p {
  margin: 0;
  color: var(--ink-dark);
}

.home-notebook__flash-message--alert {
  border-left-color: #d32f2f;
  background-color: rgba(211, 47, 47, 0.1);
}

.home-notebook__flash-message--alert p {
  color: #b71c1c;
}

.home-notebook__flash-message--notice,
.home-notebook__flash-message--success {
  border-left-color: #388e3c;
  background-color: rgba(56, 142, 60, 0.1);
}

.home-notebook__flash-message--notice p,
.home-notebook__flash-message--success p {
  color: #2e7d32;
}

.home-notebook__form {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Journal Name in Top Section (Second Quarter) */
.home-notebook__journal-name {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 400px;
  z-index: 2;
}

.home-notebook__journal-input {
  width: 100%;
  padding: 0;
  font-family: 'EB Garamond', 'Libre Baskerville', serif;
  font-size: var(--text-xl);
  font-weight: 400;
  text-align: center;
  color: var(--paper-aged);
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: all 0.3s ease;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  resize: none;
  overflow: hidden;
  /* Hide scrollbars */
  field-sizing: content;
  /* Modern CSS to auto-resize height */
  min-height: 1.5em;
  /* Ensure at least one line */
}

.home-notebook__journal-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  opacity: 1;
}

.home-notebook__journal-input::placeholder {
  color: var(--paper-aged);
  font-style: italic;
  opacity: 0.6;
}

/* Buttons */
.home-notebook__actions {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 80%;
  max-width: 300px;
  z-index: 2;
}

.home-notebook__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  font-family: 'EB Garamond', 'Libre Baskerville', serif;
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--paper-aged);
  background: linear-gradient(135deg, var(--leather-brown) 0%, #4A2E1F 100%);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.home-notebook__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.home-notebook__button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.home-notebook__button svg {
  width: 18px;
  height: 18px;
  stroke: var(--paper-aged);
  fill: none;
  stroke-width: 2;
}

/* Email in Bottom Right */
.home-notebook__email {
  position: absolute;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: auto;
  min-width: 200px;
  max-width: 300px;
  z-index: 2;
}

.home-notebook__email-input {
  width: 100%;
  padding: 0;
  font-family: 'EB Garamond', 'Libre Baskerville', serif;
  font-size: var(--text-sm);
  color: var(--paper-aged);
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: all 0.3s ease;
  text-align: right;
  opacity: 0.8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.home-notebook__email-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  opacity: 1;
}

.home-notebook__email-input::placeholder {
  color: var(--paper-aged);
  font-style: italic;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
  .home-page {
    padding: var(--space-md);
  }

  .home-notebook {
    max-width: 100%;
  }

  .home-notebook__journal-name {
    width: 90%;
  }

  .home-notebook__journal-input {
    font-size: var(--text-lg);
    padding: 0;
  }

  .home-notebook__actions {
    width: 90%;
    gap: var(--space-sm);
  }

  .home-notebook__button {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
  }

  .home-notebook__email {
    bottom: var(--space-md);
    right: var(--space-md);
    min-width: 150px;
  }

  .home-notebook__email-input {
    font-size: var(--text-xs);
    padding: 0;
  }

  .home-notebook__created-at {
    top: var(--space-md);
    right: var(--space-md);
    font-size: var(--text-xs);
  }
}

.home-encrypt-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  z-index: 100;
  pointer-events: none;
  width: 200px;
  min-height: 120px;
}

.home-encrypt-animation .progress-circle {
  width: 80px;
  height: 80px;
}

.home-encrypt-animation .progress-circle__icon svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .home-encrypt-animation .progress-circle {
    width: 60px;
    height: 60px;
  }

  .home-encrypt-animation .progress-circle__icon svg {
    width: 16px;
    height: 16px;
  }
}