@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

:root {
    --grass-green: #2e7d32;
    --dark-green: #1b5e20;
    --sand: #fdd835;
    --white: #ffffff;
    --ball-shadow: rgba(0, 0, 0, 0.2);
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: transparent;
    /* Allow canvas to show through */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #333;
}

.container {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 10;
}

.logo {
    max-width: 160px;
    margin-bottom: 1.5rem;
    filter: brightness(0) saturate(100%);
    /* Force black */
    opacity: 0.9;
}

h1 {
    color: var(--dark-green);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    width: 100%;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-green);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #f9f9f9;
    display: block;
}

input:focus {
    border-color: var(--grass-green);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.1);
    outline: none;
}

button {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(to right, var(--grass-green), var(--dark-green));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.success {
    background-color: #dcedc8;
    color: var(--dark-green);
    border: 1px solid #c5e1a5;
}

.error {
    background-color: #ffcdd2;
    color: #c62828;
    border: 1px solid #ef9a9a;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 20px;
}

/* Golf Animation */
#golf-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    /* Solid white to hide form */
    display: none;
    /* Hidden by default */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Only show when this class is added */
#golf-animation.show-animation {
    display: flex;
}

.scene {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 20px;
}

.hole {
    width: 60px;
    height: 15px;
    background: #3e2723;
    border-radius: 50%;
    position: absolute;
    bottom: 10px;
    z-index: 1;
}

/* The front lip of the hole to mask the ball as it enters */
.hole-front {
    width: 60px;
    height: 15px;
    border-radius: 50%;
    position: absolute;
    bottom: 10px;
    z-index: 10;
    /* Gradient to simulate the ground covering the front */
    background: linear-gradient(to bottom, transparent 50%, #ffffff 50%);
    pointer-events: none;
}

.flag-pole {
    width: 4px;
    height: 120px;
    background: #cfd8dc;
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
}

.flag {
    width: 50px;
    height: 30px;
    background: #c62828;
    position: absolute;
    top: 0;
    left: 100%;
    border-radius: 0 4px 4px 0;
}

.ball {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, #fff, #e0e0e0);
    border-radius: 50%;
    box-shadow: 2px 5px 10px rgba(0, 0, 0, 0.2);
    position: absolute;
    bottom: 20px;
    left: 50%;
    margin-left: -20px;
    /* Center alignment */
    z-index: 5;
    /* Between hole (1) and hole-front (10) */
}

/* Dimples */
.ball::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 8px 8px;
    border-radius: 50%;
}

@keyframes rollIn {
    0% {
        transform: translate(-150px, 0) rotate(0deg);
    }

    60% {
        transform: translate(0, 0) rotate(720deg);
    }

    70% {
        transform: translate(0, 0) rotate(720deg);
    }

    100% {
        transform: translate(0, 15px) rotate(720deg) scale(0.8);
        opacity: 0;
    }
}

.animate-roll {
    animation: rollIn 2s ease-out forwards;
}