:root {
    --bg-cream: #F7F5F2;
    --bg-white: #FFFFFF;
    --text-primary: #5A5957;
    --text-secondary: #84827E;
    --border-color: #DFDDDA;
    --gold-main: #E2C670;
    --gold-deep: #C9AC4E;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 10px 20px;
    font-family: "Inter", sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: 4px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.upload-header {
    text-align: center;
}

.branding-line {
    text-align: center;
    color: var(--gold-deep);
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.is-hidden {
    display: none !important;
}

h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-family: "Playfair Display", serif;
    font-weight: 500;
    font-size: 2rem;
    color: var(--text-primary);
}

.subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.couple-photo {
    width: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.upload-content {
    margin-top: 0;
}

input,
button {
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"] {
    margin-bottom: 1.5rem;
    padding: 14px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    background: var(--bg-white);
    font-family: "Inter", sans-serif;
    font-weight: 300;
}

input[type="text"]:focus {
    border-color: var(--gold-deep);
}

input[type="file"] {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input[type="file"]::file-selector-button {
    border: 1px solid var(--gold-main);
    background-color: transparent;
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 15px;
    font-family: "Inter", sans-serif;
    transition: all 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background-color: var(--gold-main);
    border-color: var(--gold-main);
}

button#uploadBtn {
    padding: 14px;
    background: var(--gold-main);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1.5rem;
    font-family: "Inter", sans-serif;
    letter-spacing: 0.5px;
}

button#uploadBtn:hover {
    background: var(--gold-deep);
}

button#uploadBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#status {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    white-space: pre-line;
    color: var(--text-secondary);
    text-align: center;
}

#errorBox {
    background: #fcf2f2;
    padding: 16px;
    border-radius: 4px;
    color: #b91c1c;
    margin-bottom: 2rem;
    display: none;
    border: 1px solid #fee2e2;
    font-size: 0.9rem;
}

#errorBox ul {
    margin: 0;
    padding-left: 20px;
    margin-top: 8px;
}

#previewContainer {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.previewItem {
    position: relative;
}

.previewItem img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid var(--border-color);
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.previewItem.complete img {
    opacity: 0.65;
    filter: grayscale(25%);
}

.removeBtn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    color: white;
    border: none;
    font-size: 10px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background 0.2s;
}

.removeBtn:hover {
    transform: scale(1.1);
    background: var(--gold-deep);
}

.progressBar {
    width: 100%;
    height: 4px;
    background: var(--bg-cream);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.progressFill {
    height: 100%;
    background: var(--gold-main);
    width: 0%;
    transition: width 0.3s ease;
}

.tick {
    position: absolute;
    bottom: 10px;
    right: 6px;
    background: var(--gold-main);
    color: var(--text-primary);
    font-size: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.successMessage {
    margin-top: 1.5rem;
    padding: 14px 16px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.95rem;
    border: 1px solid #d9eadf;
    background: #f6fbf7;
    color: #496652;
}

#loadingOverlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    z-index: 999;
}

#loadingOverlay::after {
    content: "";
    width: 40px;
    height: 40px;
    margin-top: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--gold-main);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 560px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }

    .container {
        padding: 24px 20px 28px;
    }
}