:root {
    --primary-red: #D0021B;
    --primary-blue: #003087;
    --white: #FFFFFF;
    --light-bg: #FFFFFF;
    --text-dark: #1A1A2E;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background: var(--white);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
}

.text-red {
    color: var(--primary-red);
}

.text-blue {
    color: var(--primary-blue);
}

.text-italic {
    font-style: italic;
}

.bold {
    font-weight: 700;
}

/* Layout Components */
.container {
    padding: 24px;
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

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

/* Buttons */
.btn-primary {
    background: var(--primary-red);
    color: var(--white);
    border-radius: 99px;
    padding: 14px 24px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-primary:active {
    transform: scale(0.97);
    filter: brightness(0.9);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border-radius: 9999px;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    backdrop-filter: blur(4px);
}

/* Form Fields */
.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary-blue);
    font-size: 15px;
}

.input-field {
    background: #E8F0FE;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    width: 100%;
    outline: none;
    font-family: inherit;
    margin-bottom: 24px;
}

.input-field:focus {
    border-color: var(--primary-blue);
}

textarea.input-field {
    min-height: 100px;
    resize: none;
}

.word-counter {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Curvilinear Footer Wrapper */
.footer-waves {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 140px;
    z-index: 1;
    pointer-events: none;
}

.wave-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Polaroid Card - Now relies on server-side framing for border */
.polaroid-card {
    display: inline-block;
    position: relative;
    max-width: 100%;
    /* Shadow remains to pop against the wall background */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.polaroid-image {
    width: 100%;
    height: auto;
    display: block;
}

.polaroid-text {
    text-align: center;
    margin-top: 12px;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-blue);
}

/* Header */
header {
    padding: 20px;
    display: flex;
    align-items: center;
}

.back-btn {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 24px;
    margin-right: 15px;
}

/* Utilities */
.hidden {
    display: none !important;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Wall Specific */
.wall-container {
    background: var(--light-bg);
    min-height: 100vh;
    padding: 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wall-header {
    text-align: center;
    margin-bottom: 40px;
}

.wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    perspective: 1000px;
}

.wall-item {
    animation: fadeInScale 0.6s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wall-stats {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--white);
    padding: 10px 20px;
    border-radius: 99px;
    box-shadow: var(--shadow);
    font-weight: 600;
}