/* MIKU Store — Member Dashboard H2H Integration, Credentials & IP Allowlist */

.h2h-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.h2h-docs-cta {
    white-space: nowrap;
    flex-shrink: 0;
}

#integrasi .h2h-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

#integrasi .h2h-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

#integrasi .h2h-card-header h2,
#integrasi .h2h-card > h2 {
    margin: 0 0 var(--space-1);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text);
}

#integrasi .h2h-muted {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.5;
}

#integrasi .h2h-card > .h2h-muted {
    margin-bottom: var(--space-4);
}

#integrasi .h2h-credential-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
}

#integrasi .h2h-credential-meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
    flex: 1 1 220px;
}

.h2h-field-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
}

#integrasi .h2h-code-value {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text);
    word-break: break-all;
}

#integrasi .h2h-inline-note {
    margin: var(--space-3) 0 var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.5;
}

#integrasi .h2h-inline-note code,
.h2h-muted code {
    color: var(--text);
    background-color: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

#integrasi .h2h-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

#integrasi .status-inactive {
    background-color: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.h2h-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
}

.h2h-btn-compact {
    min-height: 36px;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
}

.h2h-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.h2h-btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
    font-weight: 700;
}

.h2h-btn-primary:hover:not(:disabled) {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.h2h-btn-secondary {
    background-color: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

.h2h-btn-secondary:hover:not(:disabled) {
    border-color: var(--accent);
    background-color: var(--accent-soft);
}

.h2h-btn-danger {
    background-color: transparent;
    color: var(--danger-text);
    border-color: rgba(239, 68, 68, 0.45);
}

.h2h-btn-danger:hover:not(:disabled) {
    background-color: var(--danger-soft);
    border-color: var(--danger);
    color: var(--text);
}

/* --- Callback URL Form --- */
.h2h-callback-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.h2h-form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.h2h-form-field label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text);
}

.h2h-form-field label .optional-tag {
    font-weight: 400;
    color: var(--text-muted);
}

.h2h-status-feedback {
    margin-top: var(--space-2);
}

/* --- Whitelist IP Section --- */
.form-row-container {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.form-row-container input {
    flex: 1 1 auto;
    min-width: 0;
}

.form-row-container button {
    width: auto;
    white-space: nowrap;
}

.ip-error-msg {
    margin: var(--space-2) 0 0;
    font-size: var(--text-xs);
    color: var(--danger-text);
}

.current-ips-wrap {
    margin-top: var(--space-4);
}

.current-ips-title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}

#current-ips-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    min-height: 36px;
}

.ip-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 36px;
    padding: 4px var(--space-2) 4px var(--space-3);
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
}

.ip-tag-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--danger-text);
    font-size: var(--text-base);
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.ip-tag-delete:hover {
    background-color: var(--danger-soft);
    color: var(--text);
}

.h2h-empty-ips {
    width: 100%;
    padding: var(--space-4);
    background-color: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- H2H Modals (Secret Once-View & Confirm) --- */
#h2h-secret-modal .h2h-modal-card,
#h2h-confirm-modal .h2h-modal-card {
    max-width: 520px;
    width: 100%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

#h2h-secret-modal .h2h-modal-card h3,
#h2h-confirm-modal .h2h-modal-card h3 {
    text-align: left;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 var(--space-3);
    padding: 0 var(--space-8) 0 0;
}

.h2h-once-warning {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-sm);
    background-color: var(--warning-soft);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--warning);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.h2h-secret-block {
    margin-bottom: var(--space-4);
}

.h2h-secret-copy-row {
    display: flex;
    align-items: stretch;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.h2h-revealed-code {
    flex: 1 1 auto;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text);
    word-break: break-all;
    user-select: all;
}

.h2h-copy-btn {
    white-space: nowrap;
}

.h2h-confirm-desc {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.55;
}

.h2h-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

@media (max-width: 768px) {
    .h2h-section-header {
        align-items: stretch;
    }

    .h2h-docs-cta {
        width: 100%;
    }

    .form-row-container {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row-container button,
    #integrasi .h2h-action-group .h2h-btn {
        width: 100%;
    }

    .h2h-secret-copy-row,
    .h2h-modal-footer {
        flex-direction: column;
    }

    .h2h-modal-footer .h2h-btn,
    .h2h-btn-compact {
        min-height: 44px;
    }

    .ip-tag {
        min-height: 44px;
    }

    .ip-tag-delete {
        min-width: 44px;
        min-height: 44px;
    }
}
