/* =========================
   GLOBAL RESET + OPTIMIZATION
   ========================= */

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

:root {
    --colombia-green: #2e7d32;
    --colombia-green-dark: #1b5e20;
    --coffee-dark: #4b2e19;
}

/* =========================
   BODY – BACKGROUND CONFIG
   ========================= */

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: url('beans.png');
    background-size: 350px;
    background-repeat: repeat;
    background-attachment: fixed;

    animation: bgfade 1.4s ease-in-out, moveBeans 28s ease-in-out infinite;

    will-change: background-position, opacity;
}

/* Fade-in */
@keyframes bgfade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Soft-moving coffee beans */
@keyframes moveBeans {
    0% { background-position: 0 0; }
    50% { background-position: 120px 80px; }
    100% { background-position: 0 0; }
}

/* =========================
   FORM CONTAINER
   ========================= */

.container {
    max-width: 650px;
    background: rgba(255, 255, 255, 0.94);
    padding: 40px;
    margin: 100px auto;
    border-radius: 16px;
    border: 1px solid rgba(46, 125, 50, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    animation: showup 1.4s ease;
    transform-origin: top;

    will-change: transform, opacity, filter;
}

@keyframes showup {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

/* =========================
   LOGO
   ========================= */

.logo {
    width: 130px;
    display: block;
    margin: 0 auto 15px auto;
    animation: logofade 1.6s ease;
}

@keyframes logofade {
    0% { opacity: 0; transform: translateY(-10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================
   TITLE
   ========================= */

h2 {
    text-align: center;
    color: var(--coffee-dark);
    font-size: 26px;
    margin-bottom: 20px;
    position: relative;
}

h2::after {
    content: "";
    display: block;
    width: 70px;
    height: 4px;
    background: var(--colombia-green);
    margin: 10px auto 0 auto;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(46,125,50,0.6);
}

/* =========================
   FORM ELEMENTS
   ========================= */

label {
    font-weight: bold;
    margin-top: 10px;
    display: block;
    color: var(--coffee-dark);
    font-size: 15px;
}

input, textarea, select {
    width: 100%;
    padding: 14px;
    margin-top: 6px;
    margin-bottom: 20px;
    border: 1px solid #bfa88f;
    border-radius: 10px;
    font-size: 15px;
    background: #fcf9f6;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s, transform 0.2s;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
    box-sizing: border-box;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--colombia-green);
    box-shadow: 0 0 6px rgba(46, 125, 50, 0.5);
    outline: none;
    transform: scale(1.01);
}

/* Autofill fix */
input:-webkit-autofill {
    background-color: #fcf9f6 !important;
    box-shadow: 0 0 0px 1000px #fcf9f6 inset !important;
    -webkit-text-fill-color: var(--coffee-dark) !important;
}

/* Select Custom Arrow */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url('arrow.svg');
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-check-input[type=checkbox] {
    border-radius: .25em;
    display: inline-block;
    width: auto;
}

.form-check-label {
    display: inline-block;
}

/* =========================
   BUTTON
   ========================= */

button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--colombia-green), var(--colombia-green-dark));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 19px;
    cursor: pointer;
    transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
    font-weight: bold;
    letter-spacing: 0.3px;
}

button:hover {
    background: linear-gradient(135deg, #45b14c, var(--colombia-green));
    transform: translateY(-3px);
    box-shadow: 0 0 18px rgba(46, 125, 50, 0.6);
}

/* =========================
   FOOTER
   ========================= */

.footer {
    text-align: center;
    margin-top: 25px;
    color: rgba(46, 125, 50, 0.7);
    font-size: 14px;
}

/* =========================
   DARK MODE SUPPORT
   ========================= */

@media (prefers-color-scheme: dark) {
    .container {
        background: rgba(0, 0, 0, 0.55);
    }

    label, h2 {
        color: #eee;
    }

    input, textarea, select {
        background: #222;
        color: #fff;
        border-color: #444;
    }

    button {
        background: linear-gradient(135deg, #4cb35c, #2e7d32);
    }
}

/* =========================
   MOTION REDUCTION SUPPORT
   ========================= */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */

@media (max-width: 600px) {

    body {
        background-size: 250px;
        animation: bgfade 1.4s ease-in-out, moveBeans 40s ease-in-out infinite;
    }

    .container {
        margin: 30px 15px;
        padding: 25px;
        border-radius: 12px;
    }

    h2 {
        font-size: 22px;
    }

    .logo {
        width: 100px;
    }

    input, textarea, select {
        padding: 12px;
        font-size: 14px;
    }

    button {
        padding: 14px;
        font-size: 17px;
    }

    .footer {
        font-size: 12px;
    }
}
