/* ============================= */
/* GLOBAL STYLES */
/* ============================= */

body {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: #f5f7fa;
    margin: 0;
    line-height: 1.5;
}

/* ============================= */
/* TOP BAR (JAMK) */
/* ============================= */

.topbar {
    background: #0d004c;
    padding: 12px 20px;
}

.topbar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link img {
    height: 36px;
    display: block;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;

    /* FIX: prevent flex stretching */
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================= */
/* MAIN CONTAINER */
/* ============================= */

.container {
    max-width: 600px;
    margin: 40px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* ============================= */
/* HEADER */
/* ============================= */

h1 {
    color: #0d004c;
    margin: 0;
    font-size: 24px;
}

/* ============================= */
/* BUTTONS */
/* ============================= */

button {
    background: #0d004c;
    color: white;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

button:hover {
    background: #080036;
}

button:disabled {
    background: #999;
    cursor: not-allowed;
}

#clearBtn {
    background: #e0e0e0;
    color: #333;
}

#clearBtn:hover {
    background: #cfcfcf;
}

/* ============================= */
/* FORM INPUTS */
/* ============================= */

label {
    display: block;
    margin-top: 15px;
    font-weight: 600;
    font-size: 14px;
}

label+input,
label+textarea {
    margin-top: 5px;
}

input,
textarea {
    width: 100%;
    margin-top: 5px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #0d004c;
    box-shadow: 0 0 0 2px rgba(13, 0, 76, 0.15);
}

input.input-error,
textarea.input-error {
    border-color: #d32f2f;
    background: #fff5f5;
}

textarea {
    height: 150px;
    resize: vertical;
}

/* ============================= */
/* FIELD ERROR */
/* ============================= */

.field-error {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 4px;
}

/* ============================= */
/* INFO TEXT */
/* ============================= */

.info {
    margin-bottom: 15px;
    font-size: 14px;
    color: #555;
}

/* ============================= */
/* BUTTON ROW */
/* ============================= */

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* ============================= */
/* ATTACHMENTS */
/* ============================= */

.attachments-section {
    margin-top: 20px;
}

.attachments-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

#fileBtn {
    margin-bottom: 10px;
}

/* ============================= */
/* FILE LIST */
/* ============================= */

#fileList {
    list-style: none;
    padding: 0;
    margin: 0;
}

#fileList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f0f3f7;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: 14px;
}

#fileList li span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
}

.remove-file {
    color: #d32f2f;
    cursor: pointer;
    font-weight: bold;
}

.remove-file:hover {
    text-decoration: underline;
}

/* ============================= */
/* STATUS */
/* ============================= */

#status {
    margin-top: 20px;
    font-weight: bold;
    min-height: 20px;
}

#status.success {
    color: #2e7d32;
}

#status.error {
    color: #d32f2f;
}

#status.info {
    color: #333;
}

/* ============================= */
/* FOOTER (JAMK STYLE) */
/* ============================= */

.footer {
    background: #eeeeee;
    padding: 50px 20px 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #0d004c;
}

.footer-column a {
    display: block;
    margin-bottom: 8px;
    color: #0d004c;
    text-decoration: none;
    font-size: 14px;
}

.footer-column a:hover {
    text-decoration: underline;
}

.footer-divider {
    border-top: 1px solid #ccc;
    margin: 40px auto;
    max-width: 1100px;
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-address {
    font-size: 14px;
    color: #333;
}

.footer-logos img {
    height: 40px;
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */

@media (max-width: 600px) {

    .container {
        margin: 0;
        border-radius: 0;
        padding: 20px;
        box-shadow: none;
    }

    h1 {
        font-size: 20px;
    }

    .button-row {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    /* FIX: override full-width buttons for lang button */
    .lang-btn {
        width: auto;
    }

    .footer-content {
        flex-direction: column;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================= */
/* ATTACHMENT UI */
/* ============================= */

.attachment-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.attachment-stats {
    font-size: 13px;
    color: #0d004c;
    margin-bottom: 6px;
}

.attachment-error {
    font-size: 13px;
    color: #d32f2f;
    margin-bottom: 6px;
}

/* ============================= */
/* FIELD STATES */
/* ============================= */

input.error,
textarea.error {
    border-color: #d32f2f;
}

input.success,
textarea.success {
    border-color: #2e7d32;
}

/* ============================= */
/* SPINNER */
/* ============================= */

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: spin 0.8s linear infinite;
}

.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.honeypot {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
}