* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #ffffff;
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    width: 100%;
    padding: 10px 20px;
}

.column {
    flex: 1;
    display: flex;
    align-items: center;
}

.column:first-child {
    justify-content: flex-start;
}

.column:last-child {
    justify-content: flex-end;
}

h1 {
    text-align: center;
    background: #2c2c2c;
    color: white;

    padding: 20px;
    margin: 0 0 20px 0;
}

.form-container {
    width: 80%;
    max-width: 1000px;

    margin: 0 auto;

    display: flex;
    flex-direction: column;
    gap: 20px;
}

section {
    background: #f2f2f2;
    padding: 20px;

    border-radius: 10px;
    margin-bottom: 2rem;

    width: 100%;
    display: block;
}

section h2 {
    background: #d9d9d9;
    padding: 10px 12px;

    margin: -20px -20px 15px -20px;

    border-radius: 10px 10px 0 0;

    font-size: 16px;
}

.form-section {
    background: #f2f2f2;
    padding: 20px;

    border-radius: 10px;

    width: 100%;
    display: block;
}

.form-section h2 {
    background: #d9d9d9;
    padding: 10px 12px;

    margin: -20px -20px 15px -20px;

    border-radius: 10px 10px 0 0;

    font-size: 16px;
}
.unit-box {
    border: 1px solid #ccc;
    border-radius: 10px;

    padding: 15px;
    margin-bottom: 15px;

    background: #fff;
}

input,
select,
textarea {
    width: 100%;
    max-width: 400px;

    padding: 8px;

    border: 1px solid #ccc;
    border-radius: 8px;
}

select {
    width: auto;
    min-width: 150px;
}

textarea {
    width: 100%;
    max-width: 100%;
}

label {
    display: block;
    text-align: start;
    margin-bottom: 6px;
}

.login-card {
    background: #f2f2f2;
    padding: 2.5rem;

    border-radius: 12px;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

    width: 100%;
    max-width: 500px;

    display: flex;
    flex-direction: column;

    gap: 15px;

    direction: rtl;
    text-align: right;
}

.form-container:has(.login-card) {
    min-height: calc(100vh - 140px);

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 20px;
}

@media (max-width: 768px) {
    .form-container:has(.login-card) {
        align-items: flex-start;
        padding-top: 60px;
        min-height: auto;
    }
}

.user-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    padding: 10px 20px;
}

.submit-area {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

button {
    padding: 10px 25px;

    border: none;
    border-radius: 8px;

    background: #2c2c2c;
    color: white;

    cursor: pointer;
}

footer {
    display: flex;
    justify-content: center;

    padding: 30px 0;
}

.whatsapp-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    background: #25D366;
    color: white;

    padding: 12px 24px;
    border-radius: 50px;

    text-decoration: none;
    font-weight: bold;
}

.whatsapp-btn * {
    text-align: center;
}

#load {
    display: none;

    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.7);
    color: white;

    justify-content: center;
    align-items: center;

    flex-direction: column;

    z-index: 1000;
}

#logoutBtn {
    background-color: #e53935;
    color: white;
    border: none;

    padding: 8px 16px;
    border-radius: 8px;

    cursor: pointer;
    font-weight: bold;
}

#logoutBtn:hover {
    background-color: #c62828;
}

#userTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

#userTable th {
    background-color: #2c2c2c;
    color: white;
    padding: 12px;
    text-align: right;
}

#userTable td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

@media screen and (max-width: 600px) {
    
    #userTable thead {
        display: none;
    }

    #userTable, #userTable tbody, #userTable tr, #userTable td {
        display: block;
        width: 100%;
    }

    #userTable tr {
        background-color: #ffffff;
        border: 1px solid #ddd;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        border-radius: 8px;
    }

    #userTable td {
        text-align: right;
        border: none;
        padding: 5px 0;
        display: flex;
        justify-content: space-between;
        flex-direction: row-reverse; 
    }

    
    #userTable td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #666;
    }
}

.header-logos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 15px;
}

.logo-box {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.logo-box:first-child { justify-content: flex-start; }
.logo-box:last-child  { justify-content: flex-end; }

.scaled-logo {
    display: block;
    height: auto;
    object-fit: contain;
}

.logo-mew {
    height: 150px !important; 
    width: auto !important;
    max-width: 400px;
    cursor: pointer;
}

.logo-secondary {
    height: 58px !important;
    width: auto !important;
    max-width: 130px;
}


@media screen and (max-width: 480px) {
    .logo-mew { height: 40px !important; }
    .logo-secondary { height: 42px !important; }
}

.sidenav {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 3000;
    top: 0;
    left: 0; 
    background-color: #1a1a1a;
    overflow-x: hidden;
    transition: 0.4s ease;
    padding-top: 60px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
}

.menu-content a {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 18px;
    color: #ccc;
    display: block;
    transition: 0.3s;
    text-align: right; 
    border-bottom: 1px solid #2a2a2a;
}

.sidenav .closebtn {
    position: absolute;
    top: 10px;
    right: 20px; 
    font-size: 36px;
    color: #818181;
    text-decoration: none;
}

.menu-indicator {
    font-size: 24px;
    color: #333;
    padding-left: 8px; 
    user-select: none;
}

@keyframes nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-5px); }
}

.collapsible-section {
    background-color: #ffffff;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.collapsible-section summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #e6e6e6;
    cursor: pointer;
    list-style: none; 
}

/* Hide default arrow in Chrome/Safari */
.collapsible-section summary::-webkit-details-marker {
    display: none;
}

.collapsible-section summary h2 {
    margin: 0;
    padding: 0;
    background: none;
}

.collapsible-section .content {
    padding: 20px;
    border-top: 1px solid #ddd;
}

.collapsible-section[open] summary .icon {
    transform: rotate(180deg);
}

.collapsible-section summary .icon {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    color: #666;
}

.button-secondary {
    background: #666;
    color: white;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    table thead { display: none; }

    table tr {
        display: block;
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
    }

    table td {
        display: block;
        width: 100%;
        padding: 5px 0;
    }

    .sig-canvas {
        max-width: 100%;
        height: auto;
    }
}

div[class^="form-"] {
    padding-bottom: 20px;
    box-sizing: border-box; 
}

.required-asterisk {
    color: #dc3545; 
    margin-left: 4px;
    font-weight: bold;
}

[dir="rtl"] .required-asterisk {
    margin-left: 0;
    margin-right: 4px;
}
/* ==========================================================================
   E-Form Checkbox and Declaration Styling
   ========================================================================== */

.form-checkbox {
    margin-bottom: 20px;
    width: 100%;
}

.checkbox-outer-row {
    display: flex;
    align-items: flex-start; 
    gap: 12px;
    margin-top: 8px;
    width: 100%;
}

.checkbox-outer-row.scrollable-layout {
    align-items: flex-start; 
}


.checkbox-outer-row input[type="checkbox"] {
    flex: 0 0 auto; 
    margin: 4px 0 0 0 !important;
    padding: 0 !important;
    width: 16px !important;
    height: 16px !important;
    transform: scale(1.2);
    cursor: pointer;
}

.checkbox-agreement-text {
    flex: 1 1 auto; 
    font-weight: normal; 
    color: #333333;
    line-height: 1.5;
}


.terms-scroll-box {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #ccc;
    background: #fdfdfd;
    padding: 10px 14px;
    border-radius: 4px;
    box-sizing: border-box; 
}


.checkbox-group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.checkbox-click-binder {
    display: block;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: normal !important;
    cursor: pointer;
}


.form-link {
    color: #0066cc;
    text-decoration: underline;
    font-weight: bold;
}


form button[type="submit"]:disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.checkbox-agreement-text {
    flex: 1 1 auto;
    font-weight: normal; 
    color: #333333;
    line-height: 1.5;
    white-space: pre-line;
}

.view-text-node, .view-select-node {
    background-color: #edf2f7;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #cbd5e0;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    color: #2d3748;
}
.view-checkbox-node {
    font-weight: bold;
    color: #2f855a;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  border: 1px solid #ddd;
  padding: 12px;
  
  text-align: center;
  vertical-align: middle;
}

.validation-error-glow {
    border: 2px dashed #e53e3e !important;
    background-color: #fff5f5 !important;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.validation-error-msg {
    color: #e53e3e;
    font-size: 14px;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

.cell-error-highlight {
    border: 1.5px solid #e53e3e !important;
    background-color: #fff5f5 !important;
}
