/* --- Page Styles --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    padding: 15px;
}

.container {
    max-width: 800px;
    margin: 15px auto;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* --- Language Toggle Styles --- */
.lang-toggle {
    text-align: right;
    margin-bottom: 10px;
}
.lang-button {
    background: none;
    border: 1px solid #ccc;
    padding: 5px 10px;
    margin-left: 5px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
}
.lang-button.active {
    background-color: #0078d4;
    color: white;
    border-color: #0078d4;
    font-weight: bold;
}
.lang-button:not(.active):hover {
    background-color: #e9ecef;
}

h1 {
    color: #005a9c;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    text-align: center;
    margin-top: 0;
    font-size: 28px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.form-group.span-2 {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 15px;
}

/* --- CHECKBOX STYLES --- */
.form-group.checkbox-wrapper {
    background: #fdfdfd;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #eee;
    gap: 8px;
}
.checkbox-line {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.checkbox-line input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}
.checkbox-line label {
    font-weight: normal;
    font-size: 14px;
    margin-bottom: 0;
}
.note-preview {
    background: #f1f1f1;
    border-radius: 4px;
    padding: 10px;
}
.note-preview p {
    font-size: 13px;
    color: #555;
    font-style: italic;
    margin: 0;
    line-height: 1.4;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
}

.form-group input[type="file"] {
    padding: 8px;
}

.checkbox-line input[type="checkbox"] {
    padding: 0;
}

/* --- Button Styles --- */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

button {
    flex-grow: 1;
    background-color: #0078d4;
    color: white;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
}

button:hover {
    background-color: #005a9c;
}

button.secondary {
    background-color: #6c757d;
}
button.secondary:hover {
    background-color: #5a6268;
}

/* --- Flyer/PDF Styles --- */
#flyer-content {
    padding: 30px;
    padding-top: 15px;
    box-sizing: border-box;
    overflow: hidden;
    white-space: normal !important;
    word-break: break-word;
}

.logo-container {
    text-align: center;
    margin-bottom: 10px;
}
.logo-container img {
    max-height: 65px;
    max-width: 85%;
    object-fit: contain;
}

#flyer-content h2 {
    font-size: 22px;
    color: #000;
    border-bottom: 1px solid #333;
    padding-bottom: 6px;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    line-height: 1.4;
    word-spacing: 1px;
}

#flyer-content h3 {
    font-size: 14px;
    color: #000;
    border-bottom: 1px solid #ccc;
    padding-bottom: 3px;
    margin-top: 12px;
    margin-bottom: 4px;
}

#flyer-content p, #flyer-content li {
    font-size: 11px;
    color: #000;
    line-height: 1.35;
    margin-bottom: 4px;
}

#flyer-content .flyer-section {
    margin-bottom: 8px;
}

.contact-qr-container {
    display: flex;
    gap: 10px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    align-items: center;
}
.church-info-box {
    flex: 1;
    text-align: left;
    margin-top: 10px;        /* pushes the block down slightly */
    padding-top: 6px;        /* adds internal spacing for PDF rendering */
}

#flyer-content .contact-qr-container,
#flyer-content .church-info {
    margin-top: 16px; /* ensures consistent spacing before both QR and non-QR contact boxes */
}

.qr-code-box {
    flex-shrink: 0;
    text-align: center;
}
#qr-code-container {
    width: 90px;
    height: 90px;
    padding: 4px;
    background: white;
    border: 1px solid #ccc;
    box-sizing: border-box;
}
#qr-code-container img,
#qr-code-container canvas {
    width: 100% !important;
    height: 100% !important;
}
.qr-code-box p {
    font-size: 9px;
    margin-top: 3px;
    margin-bottom: 0;
    line-height: 1.2;
}

#flyer-content .church-info {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 4px;
    text-align: left;
}
#flyer-content .church-info h3 {
    margin-top: 0;
    text-align: left;
}
#flyer-content .church-info p {
    text-align: left;
}

#flyer-content .church-info-box p,
#flyer-content .church-info-box strong {
    color: #000;
    font-size: 11px;
    margin-bottom: 2px;
    text-align: left;
}
#flyer-content .church-info-box h3 {
    margin-top: 0;
    text-align: left;
}

#flyer-content ul {
    list-style-type: disc;
    padding-left: 18px;
    margin-top: 2px;
    margin-bottom: 8px;
}
#flyer-content li strong {
    color: #000;
}
#flyer-content li {
    margin-bottom: 2px;
}

#flyer-content a {
    color: #0078d4;
    text-decoration: none;
}
#flyer-content a:hover {
    text-decoration: underline;
}

.credit-line {
    margin-top: 15px;
    text-align: center;
}
.credit-line hr {
    border: none;
    border-top: 1px solid #ccc;
    margin-bottom: 4px;
}
.credit-line p {
    font-size: 9px;
    color: #555;
    margin: 0;
}
.credit-line a {
    color: #005a9c;
}

#text-output {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
        margin: 10px auto;
    }
    h1 {
        font-size: 24px;
    }
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    button {
        padding: 10px 16px;
    }
}
