/*==========================================================
    PTN - FORM VALIDATION STYLES (Terpusat)
    ==========================================================*/

/* --- Custom Validation Messages (val-msg) --- */
.val-msg {
    font-size: 0.78rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 18px;
}

.val-msg.error {
    color: #dc2626;
}

.val-msg.success {
    color: #16a34a;
}

/* --- Input Group Validation States --- */
.input-group {
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s ease;
    background: #fff;
}

.input-group.error {
    border-color: #dc2626;
}

.input-group.success {
    border-color: #16a34a;
}

.input-group:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.input-group.error:focus-within {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.input-group.success:focus-within {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.08);
}

.input-group .form-control {
    border: none;
    background: transparent;
    box-shadow: none !important;
}

.input-group .form-control::placeholder {
    color: #94a3b8;
}

.input-group .input-group-text {
    background: #f8fafc;
    border: none;
    color: #94a3b8;
    padding: 11px 14px;
    font-size: 0.95rem;
}

/* --- Bootstrap Validation Overrides (for validasi.js) --- */
.form-control.is-valid,
.form-select.is-valid {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
    /* Hapus ikon centang hijau bawaan Bootstrap */
    background-image: none;
    padding-right: 0.75rem;
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
    background-image: none;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
    /* Hapus ikon silang merah bawaan Bootstrap */
    background-image: none;
    padding-right: 0.75rem;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
    background-image: none;
}

/* Sembunyikan pesan feedback bawaan Bootstrap */
.invalid-feedback,
.valid-feedback {
    display: none !important;
}

/* --- Password Strength (shared) --- */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: 0.3s;
    border-radius: 30px;
}

.strength-fill.weak {
    background: #dc2626;
}

.strength-fill.medium {
    background: #d97706;
}

.strength-fill.good {
    background: #2563eb;
}

.strength-fill.strong {
    background: #16a34a;
}

#strengthText {
    color: #64748b;
    font-size: 0.78rem;
}

.match-text {
    min-height: 20px;
    font-size: 0.82rem;
}

/* --- Button Toggle (password show/hide) --- */
.btn-toggle {
    border: none;
    background: transparent;
    padding: 11px 14px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-toggle:hover {
    color: #4f46e5;
}