/* Pagrindinis konteineris - Kortelė */
.contact-container {
    max-width: 420px;
    margin: 1rem auto;
    padding: 1.5rem;
    background-color: var(--bg-surface);
    border-radius: 24px;
    border: 1px solid var(--line-muted);
    box-shadow: 0 10px 30px rgba(45, 42, 38, 0.08);
    flex-grow: 0; 
}

.contact-container h2 {
    color: var(--slate-earth);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

#contact-form input, 
#contact-form textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 16px;
    background-color: var(--cloud-dancer);
    border: 1.5px solid var(--line-muted);
    border-radius: 14px;
    color: var(--slate-earth);
    transition: all 0.2s ease-in-out;
}

#contact-form input:focus, 
#contact-form textarea:focus {
    outline: none;
    border-color: var(--amber);
    background-color: var(--bg-surface);
    box-shadow: 0 0 0 4px rgba(217, 182, 72, 0.15);
}

#contact-form textarea {
    min-height: 120px;
    resize: none;
}

.math-container {
    display: flex;
    flex-direction: 
    column; gap: 6px; 
    margin-bottom: 15px;
}

.math-inline { 
     display: flex; 
     align-items: center; 
     gap: 8px; 
}

.math-container label {
    font-size: 0.9rem;
    color: var(--slate-earth);
    font-weight: 600;
}

.math-container input {
    /* Inherits your modern iOS-style input rules automatically */
    max-width: 100px; /* Math answers are short, no need for full width */
}

.math-container input:focus {
    border-color: var(--amber);
}

#contact-form input {
    display: inline-block;
}

.shake {
    animation: shakeAnim 0.3s ease;
}

/* RED BORDER FOR WRONG MATH */
.math-container input.math-error:focus {
    border-color: red !important;
    box-shadow: 0 0 8px red !important;
}

.math-inline input[name="math_input"].math-error {
    border: 3px solid red !important;
    background-color: #ffe6e6 !important;
    box-shadow: 0 0 8px red !important;
}

.math-inline input[name="math_input"].shake {
    position: relative;
    animation: shakeAnim 0.3s ease;
}

.math-inline input.shake {
    position: relative !important;
    display: inline-block !important;
}

.success-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Occupy same space as form to prevent layout shift */
    min-height: 300px; 
    padding: 20px;
    background-color: transparent;
    border: none;
    box-shadow: none;
    animation: fadeIn 0.4s ease-in-out;
}

.success-view h2 {
    color: var(--tortoise);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.success-view p {
    color: var(--slate-earth);
    font-weight: 300;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shakeAnim {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}