:root {
    --primary-color: #E6B800;
    /* Harvest Gold */
    --accent-color: #D35400;
    /* Pumpkin/Rust */
    --bg-gradient-start: #2C1810;
    /* Dark Coffee Bean */
    --bg-gradient-end: #4E342E;
    /* Warm Brown */
    --text-color: #FDF5E6;
    /* Old Lace */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --coffee-dark: #3e2723;
    --coffee-liquid: #6f4e37;
    --body-font-size: 1rem;
    --body-text-color: rgba(255, 255, 255, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.main-container {
    display: flex;
    width: 95%;
    max-width: 1400px;
    min-height: 80vh;
    align-items: center;
    margin-bottom: 2rem;
}

/* --- Visual Section (Left) --- */
.visual-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* Story text inside card */
.story-text-card p {
    margin-bottom: 1rem;
}

/* --- Coffee Machine CSS Art --- */
.coffee-machine-container {
    position: relative;
    width: 300px;
    height: 400px;
}

.machine-body {
    position: absolute;
    bottom: 0;
    width: 240px;
    height: 340px;
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    border-radius: 20px 20px 5px 5px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow:
        inset -10px 0 20px rgba(0, 0, 0, 0.1),
        inset 5px 0 10px rgba(255, 255, 255, 0.5),
        0 15px 35px rgba(0, 0, 0, 0.4);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-logo {
    position: absolute;
    top: 90px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 5;
}

/* Bean Hopper */
.bean-hopper {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 60px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px 5px 30px 30px;
    overflow: hidden;
    z-index: 1;
}

.beans-visual {
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #3e2723 4px, transparent 5px);
    background-size: 15px 15px;
    opacity: 0.8;
}

/* Control Panel */
.control-panel {
    width: 100%;
    height: 80px;
    background: #333;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 15px;
    padding-top: 15px;
    border-bottom: 2px solid #222;
}

.display-screen {
    width: 120px;
    height: 30px;
    background: #111;
    border: 1px solid #555;
    border-radius: 4px;
    color: #0f0;
    font-family: monospace;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.buttons {
    display: flex;
    gap: 15px;
}

/* Buttons */
.btn {
    width: 14px;
    height: 14px;
    background: #444;
    border-radius: 50%;
    box-shadow: inset 1px 1px 3px rgba(255, 255, 255, 0.3), 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    cursor: pointer;
}

.btn.power-btn {
    background: #444;
    border: 1px solid #222;
}

.btn.power-btn::after,
.btn.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.btn.power-btn::after {
    background: #0f0;
    box-shadow: 0 0 5px #0f0;
}

.btn.mode-btn.active::after {
    background: #ff9800;
    box-shadow: 0 0 5px #ff9800;
}

.spout-group {
    position: absolute;
    top: 110px;
    width: 60px;
    height: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 3;
}

.spout {
    position: static;
    /* Reset absolute from previous */
    width: 15px;
    height: 25px;
    background: #333;
    border-radius: 0 0 5px 5px;
    background: linear-gradient(90deg, #444, #111);
}

/* Drip Tray */
.drip-tray {
    position: absolute;
    bottom: 0px;
    width: 100%;
    height: 25px;
    background: #333;
    border-radius: 0 0 5px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.grill {
    width: 80%;
    height: 100%;
    background-image: repeating-linear-gradient(90deg,
            #444,
            #444 2px,
            #222 2px,
            #222 6px);
}

/* Update Cup Position */
/* Stream (Liquid) */
.stream {
    position: absolute;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 0;
    /* Animated height */
    background: var(--coffee-liquid);
    z-index: 2;
    transition: height 0.5s ease-in;
}

.milk-stream {
    background: #fff;
    left: 54%;
    z-index: 3;
}

.stream.pouring {
    height: 80px;
}

/* Cup */
.cup {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 60px;
    background: #fff;
    border-radius: 0 0 30px 30px;
    box-shadow: inset -5px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 3;
    overflow: hidden;
}

.cup::after {
    /* Handle */
    content: '';
    position: absolute;
    right: -15px;
    top: 10px;
    width: 20px;
    height: 25px;
    border: 5px solid #fff;
    border-left: none;
    border-radius: 0 15px 15px 0;
}

.coffee {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    /* Animated */
    background: var(--coffee-liquid);
    transition: height 2s ease-out 0.5s;
}

.coffee.filled {
    height: 60%;
    /* Leave room for foam */
}

.milk-froth {
    position: absolute;
    bottom: 60%;
    /* Starts on top of coffee */
    left: 0;
    width: 100%;
    height: 0;
    background: #fff;
    transition: height 1s ease-out;
    z-index: 2;
}

.milk-froth.filled {
    height: 20%;
}

/* Steam Animation */
.steam {
    position: absolute;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    display: flex;
    justify-content: center;
    gap: 5px;
    opacity: 0;
    transition: opacity 1s;
    z-index: 5;
    pointer-events: none;
}

.steam.visible {
    opacity: 0.6;
}

.steam span {
    width: 4px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    filter: blur(4px);
    animation: steamRise 2s infinite;
}

.steam span:nth-child(2) {
    animation-delay: 0.5s;
    height: 30px;
}

.steam span:nth-child(3) {
    animation-delay: 1s;
}

@keyframes steamRise {
    0% {
        transform: translateY(0) scaleX(1);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(-40px) scaleX(2);
        opacity: 0;
    }
}

/* Shaking Animation for Machine */
@keyframes shake {
    0% {
        transform: translate(-50%, 0) rotate(0deg);
    }

    25% {
        transform: translate(-51%, 1px) rotate(-1deg);
    }

    75% {
        transform: translate(-49%, -1px) rotate(1deg);
    }

    100% {
        transform: translate(-50%, 0) rotate(0deg);
    }
}

.machine-body.brewing,
.machine-body.grinding {
    animation: shake 0.2s infinite;
}

.machine-body.grinding {
    animation-duration: 0.1s;
    /* Faster shake for grinding */
}

/* --- Form Section (Right) --- */
.form-section {
    flex: 1;
    display: flex;
    justify-content: center;
}

.glass-card {
    width: 100%;
    max-width: 450px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(212, 163, 115, 0.25);
    color: #fff;
    transition: transform 0.3s ease;
}

/* Unified Body Text Style */
.glass-card p,
.story-text-card p,
.manual-pay p,
.small-hint,
.scan-instruction {
    font-size: var(--body-font-size);
    color: var(--body-text-color);
    line-height: 1.6;
}

.content-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.content-header p {
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

input,
textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.submit-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(231, 111, 81, 0.4);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loader */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #fff;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

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

/* Success Message */
.success-message {
    text-align: center;
}

.payment-info {
    margin-top: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 10px;
}

.iban-box {
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    user-select: all;
    /* Easy copy */
}

.qr-container {
    background: #fff;
    padding: 10px;
    width: 150px;
    height: 150px;
    margin: 10px auto;
    border-radius: 8px;
}

.qr-container img {
    width: 100%;
    height: 100%;
}

.small-hint {
    margin-top: 10px;
}

.hidden {
    display: none;
}

/* scan instruction details */
.scan-instruction {
    background: rgba(255, 255, 255, 0.05);
    color: #333;
    /* Override text color for contrast */
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
    margin: 10px 0;
}

.manual-pay p {
    margin-top: 15px;
}

/* Fireworks */
.firework-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    /* Let clicks pass through */
    z-index: 9999;
}

@keyframes firework-pop {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
    }

    .coffee-machine-container {
        transform: scale(0.6);
        transform-origin: center;
    }

    .glass-card {
        padding: 1.5rem;
    }
}