﻿/* ============================================================
   assets/css/style.css
   Main stylesheet - HADIAH DARI KHOLIS GANTENG
   ============================================================ */

/* --- GOOGLE FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* --- CSS VARIABLES --- */
:root {
  --primary:     #1a1a2e;
  --secondary:   #16213e;
  --accent:      #00d46a;
  --accent-dark: #00a854;
  --accent-glow: rgba(0, 212, 106, 0.3);
  --white:       #ffffff;
  --light:       #f8f9fa;
  --gray:        #6c757d;
  --card-bg:     rgba(255,255,255,0.05);
  --card-border: rgba(255,255,255,0.1);
  --danger:      #ff4757;
  --warning:     #ffa502;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 8px 32px rgba(0,0,0,0.3);
  --transition:  all 0.3s ease;
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, #0f3460 100%);
  min-height: 100vh;
  color: var(--white);
  overflow-x: hidden;
}

/* --- FLOATING STARS BACKGROUND --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.15), transparent),
    radial-gradient(2px 2px at 80% 10%, rgba(255,255,255,0.1), transparent),
    radial-gradient(1px 1px at 50% 60%, rgba(255,255,255,0.12), transparent),
    radial-gradient(2px 2px at 10% 80%, rgba(0,212,106,0.15), transparent),
    radial-gradient(1px 1px at 70% 90%, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

/* --- LAYOUT WRAPPER --- */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

/* --- CARD --- */
.card {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- CARD HEADER --- */
.card-header {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

.card-header .gift-icon {
  font-size: 3.5rem;
  display: block;
  animation: bounce 2s infinite;
  line-height: 1;
  margin-bottom: 0.5rem;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.card-header h1 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--white);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  line-height: 1.3;
}

.card-header .subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  margin-top: 0.4rem;
}

/* --- CARD BODY --- */
.card-body {
  padding: 2rem 1.75rem;
}

/* --- FORM ELEMENTS --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: rgba(255,255,255,0.9);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
}

.form-control::placeholder {
  color: rgba(255,255,255,0.4);
}

.form-control:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control option {
  background: var(--secondary);
  color: var(--white);
}

/* --- PASSWORD WRAPPER --- */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-control {
  padding-right: 3rem;
}

.btn-toggle-pass {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  font-size: 1.1rem;
  transition: color 0.2s;
  padding: 0.25rem;
  line-height: 1;
}

.btn-toggle-pass:hover { color: var(--accent); }

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: var(--white);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-primary:active { transform: translateY(0); }

.btn-danger {
  background: linear-gradient(135deg, #c0392b, var(--danger));
  color: var(--white);
  width: auto;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-danger:hover { filter: brightness(1.15); transform: scale(1.03); }

/* --- ALERT / ERROR MESSAGES --- */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.alert-danger {
  background: rgba(255,71,87,0.2);
  border: 1px solid rgba(255,71,87,0.4);
  color: #ff8a95;
}

.alert-success {
  background: rgba(0,212,106,0.2);
  border: 1px solid rgba(0,212,106,0.4);
  color: #6dffa9;
}

/* --- INVALID FIELD --- */
.invalid-feedback {
  display: none;
  color: #ff8a95;
  font-size: 0.82rem;
  margin-top: 0.3rem;
  font-weight: 600;
}

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255,71,87,0.2);
}

.form-control.is-invalid ~ .invalid-feedback,
.invalid-feedback.show {
  display: block;
}

/* --- DIVIDER --- */
.divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 1rem 0;
}

/* --- EMOJI ACCENT --- */
.emoji-row {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: 4px;
}

/* --- SUCCESS PAGE --- */
.success-wrapper {
  text-align: center;
  padding: 2rem 1.75rem;
}

.success-icon {
  font-size: 5rem;
  display: block;
  animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
  margin-bottom: 1rem;
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-wrapper h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.success-wrapper .message {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.waiting-box {
  background: rgba(0,212,106,0.1);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 700;
}

/* --- CONFETTI CANVAS --- */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* --- RESPONSIVE --- */
@media (max-width: 480px) {
  .card { max-width: 100%; border-radius: 12px; }
  .card-header { padding: 1.5rem 1rem 1rem; }
  .card-header h1 { font-size: 1.2rem; }
  .card-body { padding: 1.5rem 1.25rem; }
}
