/* --- 1. Safe Box Sizing --- */
#main .inside, 
.ce_form, 
.widget, 
input, 
textarea, 
button {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* --- 2. Header & Navigation --- */
#header {
    background: #f8f9fa;
    padding: 20px 0;
    display: flex;
    justify-content: center; 
    align-items: center;
    border-bottom: 1px solid #eee;
}

#header ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 30px;
}

#header a, #header strong {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#header .active {
    border-bottom: 2px solid #000;
}

/* --- 3. Unified Content Alignment --- */
#main .inside {
    max-width: 800px; 
    margin: 0 auto;   
    padding: 60px 20px;
}

.ce_form {
    max-width: 100%;
    margin: 0;
}

/* --- 4. Synchronized Headings --- */
h1, h2, .ce_form h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    padding: 0 0 15px 0;
    color: #000;
    text-align: left;
    border-bottom: 1px solid #eee;
    display: block;
    width: 100%;
}

/* --- 5. Form Grid Layout --- */
.widget {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 15px 25px;
    margin-bottom: 2rem;
    align-items: start;
}

.widget label {
    font-weight: 600;
    font-size: 0.85rem;
    padding-top: 12px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.widget input.text, 
.widget textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fafafa;
    font-size: 1rem;
}

.widget input.text:focus, 
.widget textarea:focus {
    outline: none;
    border-color: #000;
    background-color: #fff;
}

.widget .help {
    grid-column: 2;
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

/* --- 6. Altcha & Submit (Centered & Balanced) --- */
.widget-altcha, 
.widget-submit {
    grid-column: 2;
}

altcha-widget {
    --width: 100%;
    max-width: 500px;
    min-width: 300px;
    display: block;
    margin-top: 10px;
}

button.submit {
    background-color: #222;
    color: #fff;
    padding: 14px 50px;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
    
    /* Perfect Centering Logic */
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    
    /* Spacing Fix */
    letter-spacing: 0.15em;
    text-indent: 0.15em; /* This "pushes back" the text to fix the spacing offset */
}

button.submit:hover {
    background-color: #000;
}

/* --- 7. Mobile Adjustments --- */
@media (max-width: 600px) {
    .widget {
        grid-template-columns: 1fr;
    }
    
    .widget .help, 
    .widget-altcha, 
    .widget-submit {
        grid-column: 1;
    }

    altcha-widget {
        max-width: 100%;
        min-width: unset;
    }
}