/* --- COLOR PALETTE --- */
:root {
    --yellow: #ffc400;          
    --green: #0dac2f;           
    --black: #111111;           
    --white: #ffffff;           
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #1a1a1a; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    padding: 10px;
}

/* --- THE POSTER CANVAS --- */
.poster-container {
    background: var(--white); 
    width: 100%;
    max-width: 380px; 
    /* INCREASED max-height to ensure everything fits */
    max-height: 98vh; 
    border-radius: 20px; 
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 3px solid var(--yellow);
}

/* --- BACKGROUND LAYERS --- */
.bg-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: 17px; 
}

/* Top Green, Bottom Yellow */
.bg-dark {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, var(--green) 0%, var(--green) 50%, var(--yellow) 50%, var(--yellow) 100%);
}

.bg-emerald {
    position: absolute;
    top: 46%; left: -35%; width: 170%; height: 90%;
    background-color: rgba(255, 255, 255, 0.14);
    transform: rotate(-18deg);
    z-index: 1;
}

.bg-layer::before {
    content: "";
    position: absolute;
    top: 41%; left: -35%; width: 170%; height: 58px;
    background-color: var(--white);
    transform: rotate(-18deg);
    z-index: 2;
}

.bg-red-line {
    position: absolute;
    top: calc(41% + 58px); left: -35%; width: 170%; height: 20px;
    background-color: rgba(255, 255, 255, 0.45);
    transform: rotate(-18deg);
    z-index: 3;
}

.bg-layer::after {
    content: "";
    position: absolute;
    top: calc(41% + 78px); left: -35%; width: 170%; height: 7px;
    background-color: rgba(255, 255, 255, 0.75);
    transform: rotate(-18deg);
    z-index: 4;
}

/* --- FOREGROUND CONTENT --- */
.poster-content { 
    position: relative;
    z-index: 1;
    /* REDUCED padding to move things up */
    padding: 10px 15px 0 15px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1; /* Allows this section to expand */
}

/* --- HEADER --- */
.header {
    text-align: center;
    margin-bottom: 5px;
    width: 100%;
}

.main-title {
    font-size: 1.3rem; 
    font-weight: 800; 
    color: var(--yellow); 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.slogan {
    font-family: 'Great Vibes', cursive; 
    font-size: 2rem; 
    color: var(--white); 
    line-height: 1;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* --- PHOTO LAYOUT --- */
.photo-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    width: 100%;
    position: relative;
    /* REDUCED height to bring the form up */
    height: 210px; 
    z-index: 2;
    padding: 0 5px; 
}

.photo-card {
    background: var(--white);
    padding: 4px 4px 18px 4px; 
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    width: 140px; 
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-card.candidate {
    left: 5px;
    transform: rotate(-4deg);
    z-index: 2;
}

.photo-card.supporter {
    right: 5px;
    transform: rotate(4deg);
    z-index: 1;
    margin-top: 10px;
}

.photo-card img {
    width: 100%;
    height: 165px; 
    object-fit: cover;
    border-radius: 6px;
    background-color: #e0e0e0;
}

.photo-label {
    position: absolute;
    bottom: 2px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--black); 
    text-transform: uppercase;
}

/* --- FORM AREA --- */
.action-area {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* REMOVED the restrictive min-height that was pushing the footer down */
    z-index: 2;
    margin-bottom: 10px;
}

.form-card {
    width: 100%;
    background: var(--white);
    padding: 10px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 2px solid var(--black);
}

.input-group { margin-bottom: 6px; }

.input-group label {
    display: block; 
    font-weight: 800; 
    font-size: 0.65rem;
    color: var(--black); 
    margin-bottom: 2px;
    text-transform: uppercase;
}

.input-group input, .input-group select {
    width: 100%; 
    padding: 5px 8px; 
    border: 1.5px solid var(--black); 
    border-radius: 6px; 
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem; 
    background: #f9f9f9;
}

.input-group input:focus, .input-group select:focus {
    outline: none; 
    border-color: var(--green);
}

.handwritten {
    font-family: 'Great Vibes', cursive; 
    font-size: 1.2rem !important;
    border: none !important;
    border-bottom: 2px dashed var(--green) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 5px !important;
}
.handwritten::placeholder { font-family: 'Montserrat', sans-serif; font-size: 0.7rem; color: #888; }

/* --- UPLOAD BUTTON --- */
.file-upload-btn {
    background: var(--black);
    color: var(--white); padding: 6px; border-radius: 6px;
    text-align: center; font-size: 0.75rem; font-weight: 800;
    cursor: pointer;
    border: 1px solid var(--yellow);
    display: block;
    width: 100%;
}
.file-upload-btn:hover { background: #333; }

#galleryInput, #cameraInput { display: none; }

/* Pledge View */
.pledge-statement {
    display: none; 
    text-align: center;
    flex-direction: column; justify-content: center; align-items: center;
    width: 100%;
    /* Set a fixed height so it matches the form area */
    height: 180px; 
    background: var(--white);
    border-radius: 12px;
    border: 2px solid var(--black);
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.pledge-statement i {
    font-size: 1.2rem; color: var(--white); margin-bottom: 5px;
    background: var(--green); border-radius: 50%;
    padding: 10px; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--yellow);
}
.pledge-statement p { font-size: 0.85rem; font-weight: 700; color: var(--black); text-transform: uppercase;}
.pledge-statement .candidate-name {
    font-size: 1rem; font-weight: 800; color: var(--black); margin-top: 2px;
}
.pledge-statement .supporter-name {
    font-family: 'Great Vibes', cursive; font-size: 2.2rem;
    color: var(--green); display: block; margin: 5px 0; font-weight: bold;
}
.pledge-statement .location-text {
    font-size: 0.75rem;
    color: var(--black);
    font-weight: 800;
    text-transform: uppercase;
}

/* --- FOOTER BANNER --- */
.footer-banner {
    position: relative;
    z-index: 1;
    background:white smoke; 
    color: var(--black); 
    text-align: center;
    
   
    border-top: 2px solid var(--black); 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    /* Push it firmly to the bottom */
    margin-top: auto; 
}

.footer-socials {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem; 
    font-weight: 800;
}

.footer-socials i {
    font-size: 1.3rem; 
    color: var(--black);
}

.footer-website {
    font-size: 0.85rem; 
    font-weight: 800;
    color: var(--green); 
    letter-spacing: 0.5px;
}

/* --- BUTTONS --- */
.action-buttons {
    display: flex; gap: 10px; margin-top: 10px; justify-content: center; width: 100%; max-width: 380px;
    z-index: 10;
}
.btn {
    border: none; padding: 10px 15px; font-size: 0.85rem; font-weight: 800;
    border-radius: 25px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; gap: 6px; transition: 0.2s; color: var(--white);
    flex: 1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.btn-submit { background: var(--green); border: 2px solid var(--yellow); }
.btn-share { background: var(--black); border: 2px solid var(--yellow); }

/* --- LIVE CAMERA MODAL --- */
.camera-modal {
    display: none;
    position: fixed; inset: 0; z-index: 1000;
    background: var(--black);
    flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; padding: 16px;
}
.camera-modal.open { display: flex; }
.camera-hint { color: var(--white); font-weight: 700; font-size: 0.9rem; }
.camera-frame {
    width: min(88vw, 340px);
    aspect-ratio: 145 / 175; 
    border: 3px solid var(--yellow);
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}
.camera-frame video {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1); 
}
.camera-actions { display: flex; gap: 10px; width: min(88vw, 340px); }
.btn-cancel { background: var(--black); border: 2px solid var(--yellow); }
.btn-snap { background: var(--yellow); color: var(--black); border: 2px solid var(--yellow); }