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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    background-color: #f4f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Latha", "Mukta Malar", Helvetica, Arial, sans-serif;
    color: #111;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.container {
    width: 100%;
    max-width: 480px;
    background-color: #fff;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

header {
    margin-bottom: 8px;
}

.info-note-container {
    margin-bottom: 4px;
}

.tip-toggle-btn {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 4px;
    outline: none;
}

.tip-toggle-btn .arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.tip-toggle-btn.open .arrow {
    transform: rotate(180deg);
}

.info-note {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.78rem;
    color: #1e40af;
    margin-top: 4px;
    text-align: left;
}

.info-note code {
    display: block;
    background-color: #dbeafe;
    padding: 3px 6px;
    border-radius: 4px;
    margin-top: 4px;
    word-break: break-all;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.72rem;
    color: #1e3a8a;
}

/* Language Switcher Bar below tip */
.lang-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 6px;
}

.lang-bar label {
    font-size: 0.78rem;
    color: #4b5563;
    font-weight: 600;
}

.lang-bar select {
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    outline: none;
}

.lang-bar select:focus {
    border-color: #2563eb;
}

h1 {
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    color: #000;
}

.top-fields {
    margin-bottom: 8px;
}

.line-field {
    display: flex;
    align-items: flex-end;
    margin-bottom: 8px;
}

.line-field label {
    font-size: 0.92rem;
    font-weight: bold;
    margin-right: 8px;
    padding-bottom: 1px;
    white-space: nowrap;
}

.line-field input, 
.line-field select {
    flex: 1;
    border: none;
    border-bottom: 2px dotted #000;
    font-size: 0.92rem;
    font-family: inherit;
    padding: 1px 4px;
    background-color: transparent;
    outline: none;
    border-radius: 0;
    color: #000;
    font-weight: 500;
}

.line-field select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 14px;
    padding-right: 22px;
}

.line-field input:focus,
.line-field select:focus {
    border-bottom: 2px solid #2563eb;
}

/* Role Chips Selector */
.role-section {
    background-color: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.role-section.has-error {
    border-color: #ef4444;
    background-color: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.role-title {
    display: block;
    font-size: 0.84rem;
    font-weight: bold;
    margin-bottom: 6px;
    color: #374151;
}

.required-star {
    color: #dc2626;
}

.chip-group {
    display: flex;
    gap: 6px;
}

.chip-btn {
    flex: 1;
    padding: 6px 6px;
    border: 1.5px solid #d1d5db;
    background-color: #fff;
    color: #374151;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.chip-btn:hover {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}

.chip-btn.active {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(30, 58, 138, 0.2);
}

.role-error-msg {
    margin-top: 6px;
    font-size: 0.78rem;
    color: #dc2626;
    font-weight: 600;
}

/* S-4 Table */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
    border: 2px solid #000;
    background-color: #fff;
}

.report-table td {
    border: 1px solid #000;
    padding: 6px 8px;
    font-size: 0.82rem;
    vertical-align: middle;
}

.report-table td.label-cell {
    width: 74%;
    line-height: 1.3;
}

.report-table td.input-cell {
    width: 26%;
    padding: 0;
    text-align: center;
    vertical-align: middle;
}

.req-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 2px;
    border-radius: 3px;
    padding: 1px 4px;
}

.req-badge.required-mode {
    color: #dc2626;
    background-color: #fee2e2;
}

.input-cell input[type="number"] {
    width: 100%;
    height: 38px;
    border: none;
    padding: 4px;
    font-size: 1.05rem;
    font-weight: bold;
    text-align: center;
    background-color: transparent;
    outline: none;
    -moz-appearance: textfield;
}

.input-cell input[type="number"]::-webkit-outer-spin-button,
.input-cell input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Checkbox Cell - Centered */
.checkbox-cell {
    height: 38px;
}

.custom-checkbox {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 24px;
    height: 24px;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: #fff;
    border: 2px solid #000;
    border-radius: 3px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    background-color: #f3f4f6;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #000;
    border-color: #000;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* Comments Box */
.comments-box {
    border: 2px solid #000;
    padding: 6px 8px;
    margin-bottom: 8px;
    background-color: #fff;
}

.comments-box label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 3px;
    color: #000;
}

.comments-box textarea {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    min-height: 44px;
    background-color: transparent;
    color: #000;
}

/* Form Metadata Footer (S-4-E / S-4-TL 11/23 and 1/1) */
.form-footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    font-family: Arial, sans-serif;
    color: #4b5563;
    margin-bottom: 10px;
    padding: 0 2px;
}

/* Submit Button */
button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3);
    -webkit-appearance: none;
}

button[type="submit"]:hover {
    background-color: #128C7E;
}

button[type="submit"]:active {
    transform: scale(0.99);
}

button[type="submit"]:disabled {
    background-color: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
}

/* Mobile font scaling */
@media screen and (max-width: 768px) {
    .line-field input,
    .line-field select,
    .input-cell input[type="number"],
    .comments-box textarea {
        font-size: 16px;
    }
}
