:root {
    --bg-gradient: radial-gradient(circle at top right, #fffdfa, #f5efe6);
    --primary-color: #2c2a29;
    --accent-gold: #c5a880;
    --accent-gold-hover: #b3956a;
    --card-bg: rgba(255, 255, 255, 0.75);
    --input-bg: rgba(255, 255, 255, 0.9);
    --text-main: #333130;
    --text-muted: #8e8e8e;
    --error-color: #d9534f;
    --border-color: #e8e2d9;
    --shadow-soft: 0 20px 40px rgba(197, 168, 128, 0.15);
    --shadow-button: 0 8px 25px rgba(197, 168, 128, 0.3);
    --glass-border: rgba(255, 255, 255, 0.6);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --radius-lg: 28px; --radius-md: 16px; --radius-sm: 12px;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
    --bg-gradient: radial-gradient(circle at top right, #13241d, #080f0c);
    --primary-color: #fcfbf9;
    --accent-gold: #d4af37;
    --accent-gold-hover: #b8962c;
    --card-bg: rgba(19, 36, 29, 0.55);
    --input-bg: rgba(0, 0, 0, 0.25);
    --text-main: #e8e2d9;
    --text-muted: #9baaa3;
    --border-color: #274034;
    --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.6);
    --shadow-button: 0 8px 25px rgba(212, 175, 55, 0.2);
    --glass-border: rgba(212, 175, 55, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg-gradient); font-family: var(--font-body); color: var(--text-main); line-height: 1.5; min-height: 100vh; transition: background 0.5s ease; }

.top-controls { position: absolute; top: 24px; right: 24px; z-index: 10; }
.control-btn { background: var(--card-bg); border: 1px solid var(--accent-gold); color: var(--primary-color); padding: 8px 12px; border-radius: 30px; font-size: 1rem; cursor: pointer; backdrop-filter: blur(8px); transition: var(--transition-smooth); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.control-btn:hover { background: var(--accent-gold); color: #fff; }

.app-container { max-width: 500px; margin: 0 auto; padding: 80px 20px 40px; display: flex; flex-direction: column; justify-content: center; }
.header-section { text-align: center; margin-bottom: 36px; }
.couple-name { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 600; color: var(--primary-color); margin-bottom: 8px; transition: color 0.3s; }
.heart { font-size: 1.8rem; display: inline-block; animation: pulse 2s infinite; color: var(--accent-gold); }
.subtitle { font-size: 1.05rem; color: var(--text-muted); font-weight: 300; transition: color 0.3s; }

.upload-card { background: var(--card-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 36px 28px; box-shadow: var(--shadow-soft); transition: var(--transition-smooth); }
.image-selection-area { margin-bottom: 16px; text-align: center; border: 2px dashed var(--accent-gold); border-radius: var(--radius-md); padding: 24px 20px; background: rgba(255, 255, 255, 0.05); transition: var(--transition-smooth); }
.upload-icon-decorative { font-size: 2rem; margin-bottom: 12px; opacity: 0.9; }
.action-buttons { display: flex; flex-direction: column; gap: 12px; }
.helper-text { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 24px; }
.error-text { text-align: center; font-size: 0.85rem; color: var(--error-color); margin-bottom: 24px; font-weight: 500; }
.hidden { display: none !important; }

.image-preview-container { position: relative; width: 100%; aspect-ratio: 4/5; border-radius: var(--radius-sm); overflow: hidden; box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
#imagePreview { width: 100%; height: 100%; object-fit: cover; }
.btn-remove { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,0.9); border: none; padding: 8px 16px; border-radius: 20px; font-weight: 600; color: #d9534f; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }

.guest-info-area { margin-bottom: 32px; }
.input-group { margin-bottom: 20px; }
label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; color: var(--primary-color); transition: color 0.3s; }
.optional { color: var(--text-muted); font-weight: 400; font-size: 0.8rem; }
input[type="text"], input[type="password"], textarea { width: 100%; padding: 16px; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 1rem; color: var(--text-main); transition: var(--transition-smooth); outline: none; }
input[type="text"]::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
input[type="text"]:focus, textarea:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15); }
textarea { resize: none; }
.char-count { text-align: right; font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; padding: 16px 20px; border-radius: var(--radius-md); font-family: var(--font-body); font-size: 1rem; font-weight: 500; cursor: pointer; transition: var(--transition-smooth); border: none; }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--primary-color); }
.btn-primary { background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-hover)); color: #fff; box-shadow: var(--shadow-button); text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.btn-large { font-size: 1.1rem; font-weight: 600; padding: 18px 24px; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0, 0.4); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-content { background: var(--card-bg); border-radius: var(--radius-lg); padding: 40px 30px; text-align: center; box-shadow: var(--shadow-soft); max-width: 400px; width: 100%; border: 1px solid var(--glass-border); }
.modal-icon { font-size: 3rem; margin-bottom: 16px; animation: bounceIn 0.8s; }
.modal-title { font-family: var(--font-heading); color: var(--primary-color); font-size: 2rem; margin-bottom: 12px; }
.modal-message { color: var(--text-muted); font-size: 1rem; margin-bottom: 32px; }

.fade-in { animation: fadeIn 0.8s ease-out; }
.slide-up { animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.scale-in { animation: scaleIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes bounceIn { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }
/* --- Link Ke Galeri (Bawah Kad) --- */
.bottom-action {
    text-align: center;
    margin-top: 28px;
}

.link-to-gallery {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    opacity: 0.7;
}

.link-to-gallery:hover, .link-to-gallery:active {
    opacity: 1;
    color: var(--accent-gold);
    transform: translateX(4px);
}

[data-theme="dark"] .link-to-gallery {
    color: var(--text-main);
}

[data-theme="dark"] .link-to-gallery:hover, [data-theme="dark"] .link-to-gallery:active {
    color: var(--accent-gold);
}

