*{box-sizing:border-box}body{font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;margin:0;padding:0;background-color:#eee;color:#333;direction:rtl;text-align:right;border-top:12px solid #800000;min-height:100vh;display:flex;flex-direction:column}

header {
    background: #800000;
    color: #fff;
    padding: 20px 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

header h1 {
    font-size: clamp(24px, 5vw, 32px);
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Main content wrapper - 500px max width centered */
.main-wrapper {
    max-width: 650px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 10px;
}

footer {
    text-align: center;
    font-size: 13px;
    margin: 50px 0 50px;
}

footer a {
    color: #800000;
    text-decoration: underline;
}

.footer-site-info {
    background-color: #ddd;
    background-position: center center;
    font-size: 14px;
    line-height: 1.571;
    padding: 60px 0 40px;
    text-align: center;
}

.container {
    margin: 20px auto;
    padding: 20px;
    background-color: #d0d0d0;
    border-radius: 8px;
}

.container-wide {
    max-width: 900px;
    width: 100%;
}

.container-form {
    max-width: 550px;
    width: 100%;
    border: 1px solid #888;
}

@media (max-width: 600px) {
    .container {
        padding: 5px;
        margin: 15px 0px;
        width: 100%;
        background: none;
    }

    .main-wrapper {
        padding: 0 5px;
    }
}

.welcome-section {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #f0f4f8;
    border-radius: 6px;
    border: 2px solid #800000;
}

.welcome-section h3 {
    margin: 10px 0;
    font-size: clamp(18px, 5vw, 22px);
    color: #1a3a52;
    font-weight: 600;
}

.welcome-section p {
    margin: 5px 0;
    font-size: clamp(14px, 4vw, 16px);
    word-break: break-all;
    color: #555;
}

.user-avatar {
    margin-bottom: 15px;
}

.user-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #800000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logout-link {
    margin-top: 10px;
    font-size: 13px;
}

.logout-link a {
    color: #888;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.15s;
}

.logout-link a:hover {
    color: #a01530;
    text-decoration: underline;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: clamp(14px, 4vw, 16px);
    color: #1a3a52;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: white;
    height: 48px;
    line-height: normal;
    color: #333;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 40px;
}

#by_law_group {
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

button {
    padding: 12px 24px;
    font-size: 16px;
    background: linear-gradient(135deg, #017901 0%, #005900 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.28);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(44, 90, 160, 0.18);
}

.google-btn {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    color: #1f1f1f;
    border: 1px solid #747775;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s, background-color 0.2s;
    min-height: 44px;
    font-weight: 500;
}

.google-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.google-btn:active {
    background-color: #f1f3f4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.google-btn-icon {
    background: white;
    padding: 12px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.google-btn-text {
    padding: 0 12px 0 12px;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.25px;
}

.google-btn img {
    width: 18px;
    height: 18px;
}

.login-section {
    text-align: center;
    margin-top: 25px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.login-section p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 500;
}

.login-reason {
    color: #555 !important;
    font-size: 13px !important;
    margin-top: 15px !important;
    margin-bottom: 0 !important;
    font-weight: 400 !important;
    line-height: 1.5;
    font-style: italic;
    opacity: 0.9;
}

.error-message {
    color: #c41c3b;
    background: #fef5f5;
    border-right: 4px solid #c41c3b;
    margin-bottom: 15px;
    margin-top: 15px;
    padding: 12px 15px;
    font-size: clamp(13px, 3vw, 14px);
    word-break: break-word;
    border-radius: 4px;
}

.success-message {
    color: #2d6a4f;
    background: #f0f9f6;
    border-right: 4px solid #2d6a4f;
    margin-bottom: 15px;
    padding: 12px 15px;
    font-size: clamp(13px, 3vw, 14px);
    border-radius: 4px;
}

.loader-container {
    display: none;
    margin: 20px auto;
    padding: 20px;
    text-align: center;
}

.loader-box {
    display: inline-block;
    padding: 25px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.loader-message {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: clamp(14px, 4vw, 16px);
    color: #1a3a52;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #005900;
    border-radius: 50%;
    margin: 0 auto 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.record-box {
    border: none;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #ffffff;
    font-size: clamp(13px, 3vw, 14px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

.record-box:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.record-name {
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 700;
    margin-bottom: 10px;
    color: #000;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.record-field {
    margin-top: 12px;
    word-break: break-word;
    line-height: 1.6;
    align-items: baseline;
    gap: 8px;
}

.record-field-center {
    word-break: break-word;
    line-height: 1.6;
    align-items: baseline;
    gap: 8px;
    text-align: center;
}

.record-field-small {
    line-height: 1.6;
    font-size: 14px;
}

.record-field-big {
    margin-top: 12px;
    word-break: break-word;
    line-height: 1.6;
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 20px;
}

.record-field strong {
    color: #666;
    font-weight: 600;
}

.status-code-highlight {
    background: #f0f0f0;
    color: #000;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 4px;
    display: inline-block;
}

.no-data-message {
    color: #999;
    margin-bottom: 12px;
    font-style: italic;
    font-size: clamp(13px, 3vw, 14px);
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.na-message {
    color: #999;
    margin-bottom: 12px;
    font-style: italic;
    font-size: clamp(13px, 3vw, 14px);
    padding: 10px;
    background: #f9f9f9;
    border-right: 3px solid #ccc;
    border-radius: 4px;
}

/* RTL helpers: keep code/access inputs LTR for readability */
#access_code {
    direction: ltr;
    text-align: left;
}

code {
    direction: ltr;
    text-align: left;
}

a {
    color: #2c5aa0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

a:hover {
    color: #1a3a52;
    text-decoration: underline;
}

code {
    font-family: 'Courier New', monospace;
    background: #f5f5f5;
    padding: 3px 6px;
    border-radius: 3px;
    word-break: break-all;
    color: #333;
}

/* Progress widget (RTL, step 1 on right) */
.status-progress { direction: rtl; text-align: right; margin: 8px 0 6px 0; max-width: 100%; overflow-x: hidden; }
.status-progress .current-indicator { margin: 8px 0 10px 0; font-size: 20px; color: #800000; }
.status-progress .awaiting-banner { display: inline-block; margin-inline-start: 8px; background: #d9534f; color: #fff; padding: 4px 20px; border-radius: 999px; font-size: 12px; vertical-align: middle;margin: 10px 0 5px 0; }
.status-progress .progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 15px; background: #f1f1f1; border: 1px solid #bbb; border-radius: 10px 10px 0 0; box-shadow: 0 1px 2px rgba(0,0,0,.05); flex-direction: row; max-width: 100%; box-sizing: border-box; }
.status-progress .step { display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; flex: 0 0 auto; max-width: 120px; user-select: none; position: relative; min-width: 0; }
.status-progress .circle { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #800000; color: #800000; display: flex; align-items: center; justify-content: center; font-weight: 700; background: #fff; transition: background .15s ease, color .15s ease, border-color .15s ease; flex-shrink: 0; }
.status-progress .label { font-size: 13px; margin-top: 8px; line-height: 1.2; word-wrap: break-word; }
.status-progress .connector { position: relative; flex: 0 0 30px; height: 6px; background: #dcdcdc; border-radius: 3px; }
.status-progress .connector:after { content: ""; position: absolute; top: 50%; left: -10px; transform: translateY(-50%); width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-right: 10px solid #dcdcdc; }
.status-progress .step.active .label { color: #800000;text-decoration: underline; font-weight: bold; }
.status-progress .step.completed .circle { background: #800000; color: #fff; border-color: #800000; }
.status-progress .connector.filled { background: #800000; }
.status-progress .connector.filled:after { border-right-color: #800000; }
.status-progress .step.current .circle { box-shadow: 0 0 0 3px rgba(128,0,0,.15);background: #800000; color: #fff;}
.status-progress .current-badge { position: absolute;    top: -15px;    left: 50%;    transform: translateX(-50%);    background: #fff;    color: #800000;    font-size: 11px;    padding: 2px 6px;    border-radius: 999px;    white-space: nowrap;    border: 1px solid #800000;}
.status-progress .details { margin-top: -1px; background: #f1f1f1; border: 1px solid #bbb; border-radius: 0 0 10px 10px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05); max-width: 100%; box-sizing: border-box; }
.status-progress .details h2 { margin: 0 0 8px 0; font-size: 16px; color: #800000; }
.status-progress .details p { margin: 0; font-size: 14px; line-height: 1.5; }

/* Debug boxes */
.debug-box { background: #e3f2fd; border: 1px solid #2196f3; margin: 10px; padding: 10px; font-family: monospace; }
.debug-box-warning { background: #fff3e0; border: 1px solid #ff9800; margin: 10px; padding: 10px; font-family: monospace; }
.debug-box-yellow { background: #fff3cd; border: 1px solid #ffc107; margin: 10px 0; padding: 10px; font-family: monospace; }
.debug-box-gray { background: #f8f8f8; border: 1px solid #ddd; margin: 10px 0; padding: 10px; font-family: monospace; }

/* Header */
.page-header { text-align: center; margin: 16px 0; }
.page-title { font-size: clamp(20px,4vw,28px); margin: 0; padding: 0; }

/* Loader */
.loader-container { margin: 20px auto; padding: 20px; text-align: center; }
.loader-box { display: inline-block; padding: 20px; border: 1px solid #ddd; border-radius: 6px; background: #fff; }
.loader-text { font-weight: 700; margin-bottom: 8px; }
.loader-spinner { width: 36px; height: 36px; border: 4px solid #eee; border-top-color: #007bff; border-radius: 50%; margin: 0 auto 6px; animation: spin 1s linear infinite; }

/* Status info container */
.status-info-container { margin: 12px 0; }
.status-date-info { font-size: 14px; color: #666; margin-top: 4px; }

/* Notification link */
.notification-link { margin-top: 20px; padding: 15px; background: #a9c2a9ff; border: 2px solid #005900; border-radius: 8px; text-align: center; }
.notification-link strong { color: #002800ff; font-size: 16px; }
.notification-link a { display: inline-block; margin-top: 10px; padding: 10px 20px; background: #005900; color: #dcdcdc; text-decoration: none; border-radius: 6px; font-weight: 600; }

/* Submit button full width */
.submit-button-full { width: 100%; }

/* Google sign-in container */
.gsi-container { display: flex; justify-content: center; }

/* Error message (hidden by default) */
.error-message-hidden { display: none; }

/* Coming soon section - green positive/future theme */
.coming-soon {
    background: linear-gradient(135deg, #d4edda 0%, #e8f5e9 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 24px 28px;
    margin: 30px auto 20px;
    max-width: 800px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
    text-align: right;
}

.coming-soon strong {
    display: block;
    font-size: 22px;
    color: #155724;
    margin-bottom: 16px;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: #28a745;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.coming-soon ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.coming-soon li {
    padding: 12px 0 12px 40px;
    position: relative;
    color: #1e4620;
    font-size: 16px;
    line-height: 1.6;
    border-bottom: 1px solid rgba(40, 167, 69, 0.2);
}

.coming-soon li:last-child {
    border-bottom: none;
}


/* Mobile tweaks: make connectors shorter and elements tighter */
@media (max-width: 600px) {
    .status-progress .progress { gap: 4px; padding: 15px 8px; }
    .status-progress .step { width: 50px; max-width: 50px; }
    .status-progress .circle { width: 30px; height: 30px; font-size: 13px; }
    .status-progress .label { font-size: 10px; margin-top: 4px; }
    .status-progress .connector { flex: 0 0 10px; height: 4px; }
    .status-progress .connector:after { left: -6px; border-top-width: 5px; border-bottom-width: 5px; border-right-width: 7px; }
    .status-progress .current-indicator { font-size: 16px; }
    .status-progress .details { padding: 12px; }
    .status-progress .details h2 { font-size: 14px; }
    .status-progress .details p { font-size: 13px; }
    
    .coming-soon {
        padding: 18px 20px;
        margin: 20px 10px;
    }
    
    .coming-soon strong {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .coming-soon li {
        font-size: 14px;
        padding: 10px 0 10px 35px;
    }
    
    .coming-soon li:before {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
}

/* Status Statistics Styles */
.status-statistics {
    margin: 20px 0;
    padding: 16px;
    background: #f1f1f1;
    border-radius: 10px;
    border: 1px solid #bbb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stats-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.stats-error {
    text-align: center;
    padding: 20px;
    color: #c41c3b;
    font-size: 14px;
    background: #fef5f5;
    border-radius: 4px;
    border-right: 4px solid #c41c3b;
}

.stats-header {
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 800;
    color: #800000;
    margin-bottom: 0;
    text-align: center;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    transition: background-color 0.2s ease;
}

.stats-header:hover {
    background-color: rgba(26, 58, 82, 0.05);
    border-radius: 4px;
}

.stats-header-text {
    flex: 0 1 auto;
}

.stats-toggle-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #800000;
}

.stats-header.collapsed .stats-toggle-arrow {
    transform: rotate(90deg);
}

.stats-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
    opacity: 1;
    margin-top: 8px;
}

.stats-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.stats-subheader {
    font-size: clamp(12px, 3vw, 14px);
    color: #666;
    margin-bottom: 24px;
    text-align: center;
}

/* Two-column table layout */
.stats-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.stats-table-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    align-items: center;
}

/* Column 1: Labels */
.stats-label-col {
    text-align: right;
    padding-right: 8px;
}

.stats-label-text {
    font-weight: 600;
    font-size: clamp(13px, 3vw, 14px);
    color: #333;
    white-space: nowrap;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Column 2: Bars with percentages */
.stats-bar-col {
    position: relative;
}

.stats-bar-wrapper {
    background: #e9ecef;
    border-radius: 20px;
    height: 32px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.stats-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    transition: width 0.4s ease;
    min-width: 0px;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
    padding: 0 0 0 5px;
}

.stats-bar-percent {
    color: white;
    font-weight: 700;
    font-size: clamp(12px, 3vw, 13px);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Current status highlighting */
.stats-table-row.current .stats-label-text {
    color: #28a745;
    font-weight: 700;
}

.stats-table-row.current .stats-bar-fill {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.4);
}

.stats-footer {
    text-align: center;
    font-size: 14px;
    color: #666;
    font-weight: 600;
    padding-top: 8px;
    margin-top: 12px;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 600px) {
    .status-statistics {
        padding: 12px;
    }
    
    .stats-header {
        font-size: 14px;
        margin: 12px;
    }
    
    .stats-table {
        gap: 8px;
    }
    
    .stats-table-row {
        grid-template-columns: 100px 1fr;
        gap: 8px;
    }
    
    .stats-label-text {
        font-size: 12px;
    }
    
    .stats-bar-wrapper {
        height: 28px;
    }
    
    .stats-bar-percent {
        font-size: 11px;
    }
    
    .stats-bar-fill {
        min-width: 0px;
    }
}