/**
 * =========================================================================
 * PORTAL PPID KEMENTERIAN KESEHATAN RI - FRONTEND FORMS UNIFIED STYLESHEET
 * File: public/frontend/assets/css/styles.css
 * Standard: Clean single stylesheet for forms, strictly ZERO duplicate classes.
 * =========================================================================
 */

/* 1. Form Card & Container Layouts */
.form-card {
    background-color: #ffffff;
    border-radius: 1.5rem;
    border: 1px solid #e2e8f0;
    padding: clamp(1.5rem, 3vw, 2rem);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
}

.form-section {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.form-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
}

/* 2. Labels, Badges & Helper Texts */
.form-label {
    display: block;
    font-size: 0.84375rem; /* 13.5px */
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.375rem;
    line-height: 1.25;
}

.form-label-required {
    color: #e11d48;
    font-weight: 800;
    margin-left: 0.125rem;
}

.form-helper-text {
    font-size: 0.6875rem; /* 11px */
    color: #64748b;
    line-height: 1.4;
    margin-top: 0.25rem;
    display: block;
}

/* 3. Form Input Controls */
.form-input {
    width: 100%;
    height: 3rem; /* 48px */
    padding: 0 1rem;
    border-radius: 0.75rem;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    font-size: 0.875rem;
    color: #0f172a;
    transition: all 0.15s ease-in-out;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-input:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.form-input:disabled,
.form-input[readonly] {
    background-color: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.form-select {
    width: 100%;
    height: 3rem;
    padding: 0 1rem;
    border-radius: 0.75rem;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    font-size: 0.875rem;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    box-sizing: border-box;
}

.form-select:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    font-size: 0.875rem;
    color: #0f172a;
    line-height: 1.5;
    resize: vertical;
    min-height: 6.5rem;
    transition: all 0.15s ease-in-out;
    box-sizing: border-box;
}

.form-textarea::placeholder {
    color: #94a3b8;
}

.form-textarea:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.form-file-input {
    width: 100%;
    font-size: 0.8125rem;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background-color: #ffffff;
    padding: 0.5rem;
    box-sizing: border-box;
    cursor: pointer;
}

.form-file-input::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: #f1f5f9;
    color: #0f172a;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.form-file-input::file-selector-button:hover {
    background-color: #e2e8f0;
}

/* 4. Checkbox & Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
}

.form-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 0.25rem;
    border: 1px solid #cbd5e1;
    accent-color: #0d9488;
    margin-top: 0.125rem;
    cursor: pointer;
}

.form-radio {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    accent-color: #0d9488;
    margin-top: 0.125rem;
    cursor: pointer;
}

.form-check-label {
    font-size: 0.8125rem;
    color: #334155;
    line-height: 1.4;
    user-select: none;
}

/* 5. Validation Feedback States */
.form-input-error {
    border-color: #f43f5e !important;
}

.form-input-error:focus {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2) !important;
}

.form-error-feedback {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #e11d48;
    margin-top: 0.25rem;
}

.form-success-feedback {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #059669;
    margin-top: 0.25rem;
}

/* 6. Form Action Buttons */
.form-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    padding: 0 1.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    background-color: #0d9488;
    border: none;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.form-btn-submit:hover {
    background-color: #0f766e;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
}

.form-btn-submit:active {
    transform: translateY(0);
}

.form-btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    padding: 0 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.form-btn-cancel:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* 7. Status Badges */
.form-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
}

.form-badge-teal {
    background-color: #ccfbf1;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.form-badge-amber {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.form-badge-rose {
    background-color: #ffe4e6;
    color: #9f1239;
    border: 1px solid #fecdd3;
}

.form-badge-blue {
    background-color: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* 8. LHKPN Document Buttons & Modal (Centralized & 100% Offline) */
.btn-lhkpn-pending {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    background-color: #d97706 !important;
    color: #ffffff !important;
    border: 1px solid #b45309 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1) !important;
    text-decoration: none !important;
}
.btn-lhkpn-pending:hover {
    background-color: #b45309 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px);
}
.btn-lhkpn-pending:active {
    transform: translateY(0);
}

.btn-lhkpn-table-pending {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    background-color: #fffbeb !important;
    color: #92400e !important;
    border: 1.5px solid #f59e0b !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}
.btn-lhkpn-table-pending:hover {
    background-color: #fef3c7 !important;
    color: #78350f !important;
    border-color: #d97706 !important;
}

.badge-lhkpn-pending {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #92400e !important;
    background-color: #fffbeb !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    border: 1px solid #fcd34d !important;
    width: fit-content !important;
}

.lhkpn-modal-wrapper {
    width: 100% !important;
    max-width: 860px !important;
    height: 86vh !important;
    max-height: 860px !important;
    min-height: 480px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    border-radius: 16px !important;
}
.lhkpn-modal-header {
    flex-shrink: 0 !important;
    width: 100% !important;
}
.lhkpn-modal-body {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 8px !important;
    overflow: hidden !important;
    background-color: #f1f5f9 !important;
}
.lhkpn-pdf-container {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    background-color: #ffffff !important;
    border-radius: 10px !important;
    border: 1px solid #cbd5e1 !important;
    overflow: hidden !important;
}
.lhkpn-pdf-iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 0% !important;
    border: none !important;
    display: block !important;
}
.lhkpn-modal-footer {
    flex-shrink: 0 !important;
    width: 100% !important;
    background-color: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 12px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    z-index: 10 !important;
}
@media (max-width: 640px) {
    [class*="lhkpn-modal-wrapper"] {
        height: 92vh !important;
        max-height: 92vh !important;
        min-height: 420px !important;
        border-radius: 14px !important;
    }
    [class*="lhkpn-modal-footer"] {
        padding: 10px 14px !important;
    }
}
