* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: #f5f6f7;
    color: #4e4e4e;
    font-family: Arial, Helvetica, sans-serif;
}

.public-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
}

.public-header {
    width: 100%;
    height: 64px;
    flex-shrink: 0;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.public-header-container {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 25px;
    display: flex;
    align-items: center;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.public-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.public-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.public-brand-title {
    color: #000000;
    font-size: 15px;
    font-weight: 700;
}

.public-brand-subtitle {
    margin-top: 3px;
    color: #777777;
    font-size: 10px;
    font-weight: 400;
}

.public-content {
    width: 100%;
    padding: 30px 0 40px;
}

.public-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
}

.wakaf-layout {
    display: grid;
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

.wakaf-form-card {
    background-color: #ffffff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.wakaf-form-card,
.map-card {
    width: 100%;
    min-width: 0;
}

.wakaf-form-card form {
    padding: 20px 22px 24px;
}


/* Jarak antarbagian formulir */
.form-section {
    margin-top: 0;
    margin-bottom: 22px;
}

.form-section:last-of-type {
    margin-bottom: 0;
}

/* Jarak judul bagian ke field pertama */
.section-title {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333333;
    font-size: 14px;
    font-weight: 600;
}

.form-group {
    margin-top: 0;
    margin-bottom: 14px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group > label:not(.file-upload) {
    display: block;
    margin-top: 0;
    margin-bottom: 6px;
    color: #555555;
    font-size: 12px;
    font-weight: 500;
}

.form-group > .file-upload {
    margin-top: 0;
    margin-bottom: 0;
}

.location-status {
    margin-top: 4px;
    margin-bottom: 14px;
    padding-left: 2px;
    color: #999999;
    font-size: 10px;
    line-height: 1.2;
}

.location-status.success {
    color: #00923f;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d8d8d8;
    border-radius: 5px;
    background-color: #ffffff;
    color: #4e4e4e;
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #ffc107;
}

.form-group input::placeholder {
    color: #aaaaaa;
}

.form-group input[readonly] {
    background-color: #f5f7f8;
    color: #555555;
}

.btn-gps {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    padding: 0 14px;
    border: 1px solid #ffc107;
    border-radius: 5px;
    background-color: #ffc107;
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.btn-gps:hover {
    background-color: #e5aa00;
}

.btn-gps:disabled {
    opacity: 0.7;
    cursor: wait;
}

.coordinate-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.location-status {
    margin-top: -4px;
    margin-bottom: -4px;
    padding-left: 2px;
    color: #999999;
    font-size: 10px;
    line-height: 1.2;
}

.location-status.success {
    color: #00923f;
}

.file-upload {
    width: 100%;
    min-height: 40px;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px;
    padding: 9px 12px;
    border: 1px dashed #bfcbd5;
    border-radius: 5px;
    background-color: #fafcfd;
    color: #777777;
    font-size: 11px;
    cursor: pointer;
}

.file-upload:hover {
    border-color: #ffc107;
    background-color: #fffdf5;
    color: #555555;
}

.file-icon {
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 17px;
    color: #777777;
}

.file-icon svg {
    width: 16px;
    height: 16px;
}

.file-upload:hover .file-icon {
    color: #555555;
}

.file-upload:has(.file-text.selected) .file-icon {
    color: #00923f;
}

.file-text {
    display: block;
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-text.selected {
    color: #00923f;
    font-weight: 500;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    height: 40px;
    padding: 0 38px 0 12px;
    border: 1px solid #d8d8d8;
    border-radius: 5px;
    background-color: #ffffff;
    color: #4e4e4e;
    font-family: inherit;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.select-wrapper select:focus {
    border-color: #ffc107;
}

.select-arrow {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    color: #777777;
    pointer-events: none;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.btn-submit {
    min-width: 100px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid #00923f;
    border-radius: 5px;
    background-color: #00923f;
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-submit:hover {
    background-color: #007d35;
    border-color: #007d35;
}

.map-card {
    position: sticky;
    top: 84px;
    background-color: #ffffff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.map-container {
    position: relative;
    width: 100%;
    height: 650px;
}

#map {
    width: 100%;
    height: 100%;
}

.map-location-button {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #dddddd;
    border-radius: 50%;
    background-color: #ffffff;
    color: #4e4e4e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 1000;
}

.map-location-button:hover {
    background-color: #f5f5f5;
}

.map-location-button svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.user-location-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #4285f4;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 6px rgba(66, 133, 244, 0.20), 0 1px 4px rgba(0, 0, 0, 0.35);
}

.public-footer {
    width: 100%;
    min-height: 58px;
    margin-top: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    background-color: #4e4e4e;
}

.public-footer-container {
    width: 100%;
    max-width: 1200px;
    min-height: 58px;
    margin: 0 auto;
    padding: 0 25px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
}

.public-footer p {
    margin: 0;
    color: #ffffff;
    font-size: 13px;
    white-space: nowrap;
}

.success-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.35);
}

.success-modal {
    width: 100%;
    max-width: 400px;
    padding: 24px;
    box-sizing: border-box;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.success-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border-radius: 50%;
    background-color: #e8f7ef;
    color: #00923f;
}

.success-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.success-modal h3 {
    margin: 0 0 8px;
    color: #4e4e4e;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
}

.success-modal > p {
    margin: 0 auto 16px;
    color: #777777;
    font-size: 14px;
    line-height: 1.5;
}

.success-button {
    min-width: 100px;
    padding: 10px 20px;
    border: 1px solid #00923f;
    border-radius: 5px;
    background-color: #00923f;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.success-button:hover {
    background-color: #007d35;
    border-color: #007d35;
}

.kode-pengajuan-box {
    margin: 16px 0;
    padding: 12px;
    border: 1px solid #ffc107;
    border-radius: 8px;
    background-color: #fff8df;
    text-align: left;
}

.kode-pengajuan-box label {
    display: block;
    margin-bottom: 8px;
    color: #4e4e4e;
    font-size: 12px;
    font-weight: 600;
}

.kode-pengajuan-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#kodePengajuanText {
    color: #4e4e4e;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.copy-kode-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 7px 10px;
    border: none;
    border-radius: 6px;
    background-color: #ffc107;
    color: #4e4e4e;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
}

.copy-kode-button:hover {
    background-color: #e5aa00;
}

.copy-kode-icon {
    display: block;
    flex-shrink: 0;
}

.kode-pengajuan-box small {
    display: block;
    margin-top: 8px;
    color: #666666;
    font-size: 12px;
    line-height: 1.4;
}

.copy-kode-message {
    display: block;
    margin-top: 4px;
    color: #00923f;
    font-size: 11px;
}

.wakaf-info-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}

.wakaf-info-popup .leaflet-popup-content {
    width: 290px;
    max-width: calc(100vw - 100px);
    margin: 0;
    padding: 15px 16px;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: #333;
}

.wakaf-info-popup .leaflet-popup-close-button {
    position: absolute !important;
    top: 15px !important;
    right: 12px !important;
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px !important;
    line-height: 20px !important;
    color: #666 !important;
    box-sizing: border-box;
    border: none !important;
    background: transparent;
}

.wakaf-info-popup .leaflet-popup-close-button:hover {
    color: #222 !important;
    background: #f3f4f6;
}

.wakaf-popup-content {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.wakaf-popup-title {
    padding: 0 25px 6px 0;
    margin-bottom: 5px;
    color: #1b4d3e;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
    border-bottom: 1px solid #e5e7eb;
}

.wakaf-popup-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 2px;
}

.wakaf-popup-row {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    column-gap: 14px;
    align-items: start;
    padding: 0;
    border: none;
    min-width: 0;
}

.wakaf-popup-label {
    min-width: 0;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    overflow-wrap: anywhere;
    word-break: normal;
}

.wakaf-popup-value {
    min-width: 0;
    color: #222;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.map-drawing-toolbar {
    position: absolute;
    top: 50px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: auto;
}

.map-tool-btn {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5d9dc;
    border-radius: 4px;
    background-color: #ffffff;
    color: #4e4e4e;
    font-family: inherit;
    font-size: 17px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.map-tool-btn:hover {
    background-color: #f1f3f4;
}

.map-tool-btn span {
    width: auto;
    flex-shrink: 0;
    font-size: 17px;
    line-height: 1;
    text-align: center;
}

.map-tool-draw {
    background-color: #00923f;
    border-color: #00923f;
    color: #ffffff;
}

.map-tool-draw:hover {
    background-color: #007d35;
    border-color: #007d35;
    color: #ffffff;
}

.map-tool-edit {
    background: #ffc107;
    border-color: #e0aa00;
    color: #ffffff;
}

.map-tool-edit:hover {
    background: #e5aa00;
    border-color: #d49b00;
    color: #ffffff;
}

.map-tool-delete {
    background: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.map-tool-delete:hover{
    background: #bb2d3b;
    border-color: #b02a37;
    color: #ffffff;
}

.map-tool-done {
    background-color: #4e4e4e;
    border-color: #4e4e4e;
    color: #ffffff;
}

.map-tool-done:hover {
    background-color: #363636;
    color: #ffffff;
}

.map-tool-btn[hidden] {
    display: none !important;
}

.map-alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
}

.map-alert-overlay[hidden] {
    display: none !important;
}

.map-alert-modal {
    width: min(360px, calc(100% - 32px));
    padding: 25px 24px 22px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.map-alert-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff3cd;
    color: #856404;
    font-size: 26px;
    font-weight: 600;
}

.map-alert-modal h3 {
    margin: 0 0 8px;
    color: #4e4e4e;
    font-size: 16px;
}

.map-alert-modal p {
    margin: 0 0 20px;
    color: #666666;
    font-size: 13px;
    line-height: 1.5;
}

.map-alert-modal button {
    min-width: 90px;
    padding: 9px 16px;
    border: 0;
    border-radius: 4px;
    background: #00923f;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
}

.map-alert-modal button:hover {
    background: #007d35;
}

.input-error {
    border: 1px solid #dc3545 !important;
}

.file-upload.input-error {
    border: 1px solid #dc3545 !important;
    background-color: #fff5f5;
}

.form-group > label:not(.file-upload)[for="latitude"]::after,
.form-group > label:not(.file-upload)[for="longitude"]::after,
.form-group > label:not(.file-upload)[for="nama_wakif"]::after,
.form-group > label:not(.file-upload)[for="no_hp"]::after,
.form-group > label:not(.file-upload)[for="peruntukan"]::after,
.form-group > label:not(.file-upload)[for="luas_tanah"]::after,
.form-group > label:not(.file-upload)[for="alas_hak"]::after,
.form-group > label:not(.file-upload)[for="ktp_nazhir"]::after,
.form-group > label:not(.file-upload)[for="kartu_keluarga"]::after,
.form-group > label:not(.file-upload)[for="foto_lokasi"]::after,
.form-group > label:not(.file-upload)[for="blanko"]::after,
.form-group > label:not(.file-upload)[for="foto_geotagging"]::after {
    content: " *";
    color: #dc3545;
    font-weight: 700;
}

.validation-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
}

.validation-modal-overlay[hidden] {
    display: none;
}

.validation-modal {
    width: 100%;
    max-width: 340px;
    padding: 22px 20px 20px;
    box-sizing: border-box;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.validation-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #f8d7da;
    color: #dc3545;
    font-size: 27px;
    font-weight: 700;
}

.validation-modal h3 {
    margin: 0 0 8px;
    color: #333333;
    font-size: 18px;
}

.validation-modal p {
    max-height: 180px;
    margin: 0 0 18px;
    overflow-y: auto;
    color: #555555;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    white-space: pre-line;
}

.validation-modal button {
    min-width: 100px;
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    background: #00923f;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.validation-modal button:hover {
    background: #007a35;
}

#latitude.input-error,
#longitude.input-error {
    border: 1px solid #dc3545 !important;
}

#latitude.location-detected,
#longitude.location-detected {
    background-color: #ffffff;
    border: 1px solid #ffc107 !important;
}

.file-upload.file-selected {
    background-color: #ffffff;
    border-color: #ffc107;
    color: #4e4e4e;
}

.form-group:has(#luas_tanah) {
    margin-top: 10px;
    padding-top: -4px;
}

.form-section {
    margin-bottom: 20px;
}

.form-section > .section-title {
    margin-top: 0;
    margin-bottom: 12px;
}

.public-map-layer-control {
    position: absolute;
    top: 12px;
    right: 10px;
    z-index: 2000;
}

#publicLayerPanel[hidden] {
    display: none !important;
}

#publicLayerPanel:not([hidden]) {
    display: block !important;
}

@media (max-width: 950px) {
    .wakaf-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .map-card {
        position: relative;
        top: auto;
    }

    .map-container {
        height: 450px;
    }
}

@media (max-width: 600px) {
    .public-header-container,
    .public-container,
    .public-content,
    .public-footer-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .public-header-container,
    .public-container {
        padding-right: 14px;
        padding-left: 14px;
        box-sizing: border-box;
    }

    .layanan-page-heading {
        margin-top: 16px;
        padding: 0 18px 6px;
    }

    .wakaf-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .wakaf-form-card,
    .map-card,
    .wakaf-form-card form,
    .map-container,
    #map {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .wakaf-form-card form {
        padding: 18px;
    }

    .coordinate-group {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .map-container {
        height: 350px;
    }

    .map-drawing-toolbar {
        top: 60px !important;
        right: 10px;
        width: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .map-tool-btn {
        min-height: 34px;
        padding: 7px 8px;
        font-size: 10px;
    }

    .public-footer-container {
        padding: 12px 18px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .public-footer p {
        font-size: 10px;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .success-modal {
        padding: 20px 16px;
        box-sizing: border-box;
    }

    .success-modal h3 {
        font-size: 17px;
    }

    .kode-pengajuan-value {
        align-items: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 400px) {
    .kode-pengajuan-value {
        align-items: flex-start;
        flex-direction: column;
    }
}

