:root {
  --gold-primary: #D4AF37;
  --gold-secondary: #B76E20;
  --cream: #F5EBDD;
  --light-gray: #E1E1E1;
  --dark-green: #3F5F3B;
  --white: #FFFFFF;
  --text-dark: #333333;
  --text-light: #555555;
  --error: #e74c3c;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--cream) 0%, var(--white) 100%);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
  background-attachment: fixed;
}

.container {
  max-width: 900px;
  margin: 30px auto;
  background: var(--white);
  padding: 40px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-secondary));
}

header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--light-gray);
}

header h1 {
  font-size: 2.8rem;
  margin-bottom: 12px;
  background: linear-gradient(45deg, var(--gold-primary), var(--gold-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

header p {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 25px;
  line-height: 1.8;
}

/* Alert box */
.alert-box {
  background: rgba(212, 175, 55, 0.15);
  border-left: 4px solid var(--gold-secondary);
  padding: 12px 15px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
}

.alert-box i {
  color: var(--gold-secondary);
}

/* Event details */
.event-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 25px 0 40px;
}

.event-details p {
  display: flex;
  align-items: center;
  background: var(--cream);
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: var(--transition);
}

.event-details p:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.event-details p i {
  margin-right: 10px;
  font-size: 1.2rem;
  color: var(--gold-secondary);
}

/* Form */
#confirm-form {
  display: grid;
  gap: 22px;
  margin-bottom: 40px;
}

#confirm-form input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  font-size: 1.05rem;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  transition: var(--transition);
  background-color: var(--white);
}

#confirm-form input[type="text"]:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

#confirm-form input.error {
  border-color: var(--error);
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

#submit-button {
  background: linear-gradient(to right, var(--gold-primary), var(--gold-secondary));
  color: var(--white);
  border: none;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(183, 110, 32, 0.25);
}

#submit-button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(183, 110, 32, 0.35);
}

#submit-button:active:not(:disabled) {
  transform: translateY(1px);
}

#submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#submit-button .confirmation-icon {
  margin-left: 10px;
  font-size: 1.2rem;
}

#submit-button.loading .button-text::after {
  content: '';
  animation: ellipsis 1.5s infinite;
  display: inline-block;
  width: 1em;
  text-align: left;
}

@keyframes ellipsis {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}

#submit-button.confirmed {
  background: linear-gradient(to right, var(--dark-green), #2d4a2a);
}

.confirmation-message {
  display: none;
  color: var(--dark-green);
  font-weight: 600;
  text-align: center;
  font-size: 1.1rem;
  padding: 15px;
  background-color: rgba(63, 95, 59, 0.1);
  border-radius: 8px;
  margin-top: 20px;
}

/* File upload */
.file-upload-container {
  position: relative;
  border: 2px dashed var(--gold-primary);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background-color: rgba(212, 175, 55, 0.05);
  margin-top: 30px;
}

.file-upload-container:hover {
  background-color: rgba(212, 175, 55, 0.1);
}

.file-upload-container.dragover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-secondary);
}

.file-upload-container.has-preview {
  border-style: solid;
  padding: 20px;
}

.file-upload-container.error {
  border-color: var(--error);
  animation: shake 0.5s;
}

.file-upload-container .file-upload-icon {
  font-size: 2.5rem;
  color: var(--gold-secondary);
  margin-bottom: 15px;
}

.file-upload-container .file-upload-text {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--gold-secondary);
  margin-bottom: 8px;
}

.file-upload-container .file-upload-instructions {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 5px;
}

.file-upload-container input[type="file"] {
  position: absolute;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.image-preview {
  margin-top: 20px;
  text-align: center;
}

.image-preview img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Guest list */
#guest-list-container {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--light-gray);
}

#guest-list-container h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.8rem;
  color: var(--gold-secondary);
}

/* Carousel */
.carousel-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  padding: 10px 0;
  cursor: grab;
}

.carousel-container.dragging {
  cursor: grabbing;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

#guest-list {
  display: flex;
  width: max-content;
  will-change: transform;
}

.guest-card {
  flex: 0 0 auto;
  width: 140px;
  margin: 0 12px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  padding: 15px;
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--light-gray);
}

.guest-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.guest-photo-container {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  background: var(--cream);
}

.guest-photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guest-name {
  font-size: 0.95rem;
  color: var(--text-dark);
  font-weight: 500;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* WhatsApp button */
.whatsapp-button {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #25D366;
  color: var(--white);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  z-index: 1000;
  transition: var(--transition);
  font-size: 1.8rem;
}

.whatsapp-button:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Footer */
footer {
  text-align: center;
  padding: 25px 0 15px;
  margin-top: 50px;
  font-size: 0.9rem;
  color: var(--text-light);
  border-top: 1px solid var(--light-gray);
}

/* Responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 30px 20px;
    margin: 20px auto;
  }
  
  header h1 {
    font-size: 2.2rem;
  }
  
  .event-details {
    flex-direction: column;
    gap: 15px;
  }
  
  .event-details p {
    justify-content: center;
  }
  
  .guest-card {
    width: 130px;
    margin: 0 8px;
  }
  
  .whatsapp-button {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 15px;
  }
  
  .container {
    padding: 25px 15px;
  }
  
  header h1 {
    font-size: 1.9rem;
  }
  
  .file-upload-container {
    padding: 25px 15px;
  }
  
  .guest-card {
    width: 110px;
  }
  
  #submit-button {
    padding: 14px;
    font-size: 1rem;
  }
  
  .alert-box {
    font-size: 0.9rem;
    padding: 10px;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}